111852024-07-15 18:49:37probaLegnagyobb téglalappython3Wrong answer 0/100172ms14844 KiB
N = input()
sor = [int(i) for i in input().split(' ')]

sor.sort(reverse=True)
h = len(sor)
i, a, b, ok = 0, None, None, True

  
while i < h-3 and h > 3:
    if sor[i] == sor[i+1] and sor[i] == sor[i+2] and sor[i] == sor[i+3]:
        print(sor[i]*sor[i])
        ok = False
        break
    
    if sor[i] == sor[i+1] and a == None:
        a = sor[i]
        i += 1
        
    elif sor[i] == sor[i+1] and b == None:
        print(a*sor[i])
        ok = False
        break
    i += 1

if ok:
    print(0)

    
        
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted18ms3116 KiB
2Accepted18ms3044 KiB
3Accepted17ms3044 KiB
subtask20/10
4Accepted18ms3188 KiB
5Wrong answer17ms3088 KiB
6Accepted17ms3220 KiB
7Accepted17ms3100 KiB
8Accepted17ms2936 KiB
subtask30/10
9Wrong answer18ms3084 KiB
10Wrong answer17ms3220 KiB
11Accepted17ms3044 KiB
12Wrong answer18ms2892 KiB
13Accepted41ms5024 KiB
14Accepted48ms4896 KiB
subtask40/15
15Accepted17ms3044 KiB
16Accepted18ms3048 KiB
17Accepted17ms3044 KiB
18Accepted18ms3200 KiB
19Accepted18ms3044 KiB
20Accepted17ms3044 KiB
21Accepted17ms3316 KiB
22Accepted17ms3088 KiB
23Accepted17ms3044 KiB
24Wrong answer17ms2916 KiB
subtask50/20
25Wrong answer18ms3436 KiB
26Accepted20ms3560 KiB
27Accepted25ms3576 KiB
28Accepted23ms3580 KiB
29Accepted25ms3684 KiB
30Accepted23ms3556 KiB
31Accepted21ms3556 KiB
32Wrong answer19ms3556 KiB
subtask60/15
33Accepted17ms3044 KiB
34Accepted57ms14844 KiB
35Accepted136ms14740 KiB
36Accepted135ms14604 KiB
37Accepted97ms14728 KiB
38Accepted71ms14716 KiB
39Accepted57ms14700 KiB
40Accepted20ms4196 KiB
41Wrong answer57ms14496 KiB
subtask70/30
42Accepted82ms14236 KiB
43Accepted82ms14840 KiB
44Accepted160ms14672 KiB
45Accepted98ms14832 KiB
46Accepted96ms14700 KiB
47Accepted104ms14764 KiB
48Accepted83ms14700 KiB
49Accepted172ms14696 KiB
50Wrong answer86ms14644 KiB
51Wrong answer82ms14540 KiB