112822024-08-03 20:43:09probaLegnagyobb téglalappython3Wrong answer 10/100158ms14852 KiB
#teglalap2
#N = 8; sor = list(map(int, '1 3 3 7 6 7 9 6'.split(' '))); sor.sort(reverse = True)
#N = 8; sor = list(map(int, '5 5 1 1 1 2 3 4'.split(' '))); sor.sort(reverse = True)
#N = 4; sor = list(map(int, '1000000 1000000 1000000 1000000'.split(' '))); sor.sort(reverse = True)
N = int(input()); sor = list(map(int, input().split(' '))); sor.sort(reverse = True)

#print(sor)

i, i1, ok = 0, None, True
while i < N and ok:
    j = 1
    while i+j < N and sor[i] == sor[i+j]:
        j += 1
        #print(j, end=' ')
    if j > 3:
        print(sor[i]**2)
        ok = False
    elif j > 1:
        if i1 == None:
            i1 = sor[i]
            i += j-1
        else:
            print(i1*sor[i])
            ok = False
    i += 1

if ok:
    print(0)


 





SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted18ms3044 KiB
2Accepted17ms3088 KiB
3Accepted17ms2916 KiB
subtask210/10
4Accepted18ms2952 KiB
5Accepted17ms2940 KiB
6Accepted17ms3048 KiB
7Accepted17ms3044 KiB
8Accepted17ms3064 KiB
subtask30/10
9Wrong answer17ms2916 KiB
10Wrong answer17ms3044 KiB
11Accepted18ms3172 KiB
12Wrong answer17ms3044 KiB
13Accepted79ms4884 KiB
14Accepted61ms4884 KiB
subtask40/15
15Accepted17ms2916 KiB
16Accepted17ms3048 KiB
17Accepted17ms3044 KiB
18Accepted17ms2916 KiB
19Accepted17ms3044 KiB
20Accepted17ms3044 KiB
21Accepted17ms3192 KiB
22Accepted17ms3044 KiB
23Accepted17ms3044 KiB
24Wrong answer17ms3044 KiB
subtask50/20
25Wrong answer18ms3172 KiB
26Accepted20ms3512 KiB
27Accepted24ms3600 KiB
28Accepted23ms3684 KiB
29Accepted25ms3524 KiB
30Accepted20ms3556 KiB
31Accepted21ms3408 KiB
32Wrong answer20ms3728 KiB
subtask60/15
33Accepted17ms3088 KiB
34Accepted50ms14804 KiB
35Accepted119ms14700 KiB
36Accepted108ms14704 KiB
37Accepted90ms14748 KiB
38Accepted63ms14852 KiB
39Accepted50ms14744 KiB
40Accepted25ms4160 KiB
41Wrong answer50ms14624 KiB
subtask70/30
42Accepted72ms14252 KiB
43Accepted75ms14832 KiB
44Accepted141ms14704 KiB
45Accepted86ms14724 KiB
46Accepted85ms14744 KiB
47Accepted92ms14704 KiB
48Accepted82ms14704 KiB
49Accepted158ms14700 KiB
50Wrong answer75ms14772 KiB
51Wrong answer76ms14696 KiB