112782024-08-03 20:27:05probaLegnagyobb téglalappython3Wrong answer 0/1001.098s14852 KiB
'''
6
5 5 1 2 3 4

4
1000000 1000000 1000000 1000000
'''

#teglalap2
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:
    try:
        j = 1
        while sor[i] == sor[i+j]:
            j += 1
        #print(j, end=' ')
        if j > 3:
            print(sor[i]**2)
        elif j > 1:
            if i1 == None:
                i1 = sor[i]
                i += j-1
            else:
                print(i1*sor[i])
                ok = False
            
    except:
        print(0)
    
    i += 1


 





SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms3064 KiB
2Accepted18ms3044 KiB
3Wrong answer17ms3044 KiB
subtask20/10
4Wrong answer17ms3044 KiB
5Wrong answer18ms2960 KiB
6Wrong answer17ms3052 KiB
7Accepted17ms3064 KiB
8Wrong answer17ms2916 KiB
subtask30/10
9Wrong answer17ms3044 KiB
10Wrong answer17ms3240 KiB
11Wrong answer17ms3044 KiB
12Wrong answer17ms2916 KiB
13Time limit exceeded1.098s4816 KiB
14Time limit exceeded1.097s4928 KiB
subtask40/15
15Accepted17ms3044 KiB
16Accepted17ms2988 KiB
17Accepted17ms2972 KiB
18Accepted17ms3044 KiB
19Accepted17ms2840 KiB
20Wrong answer17ms3192 KiB
21Accepted17ms3048 KiB
22Accepted17ms3044 KiB
23Wrong answer17ms2924 KiB
24Wrong answer17ms2916 KiB
subtask50/20
25Wrong answer19ms3228 KiB
26Accepted20ms3816 KiB
27Accepted23ms3832 KiB
28Wrong answer23ms3624 KiB
29Accepted21ms3576 KiB
30Wrong answer20ms3520 KiB
31Accepted20ms3556 KiB
32Wrong answer19ms3556 KiB
subtask60/15
33Accepted18ms3192 KiB
34Accepted50ms14664 KiB
35Accepted104ms14596 KiB
36Wrong answer97ms14700 KiB
37Accepted75ms14720 KiB
38Wrong answer59ms14724 KiB
39Accepted50ms14628 KiB
40Time limit exceeded1.097s4196 KiB
41Wrong answer50ms14640 KiB
subtask70/30
42Wrong answer76ms14108 KiB
43Accepted82ms14720 KiB
44Accepted138ms14744 KiB
45Wrong answer138ms14724 KiB
46Accepted87ms14704 KiB
47Wrong answer112ms14704 KiB
48Accepted79ms14852 KiB
49Accepted130ms14704 KiB
50Wrong answer79ms14620 KiB
51Wrong answer79ms14696 KiB