111822024-07-15 18:42:39probaLegnagyobb téglalappython3Wrong answer 0/100173ms14864 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:
    
    if sor[i] == sor[i+1] and sor[i+1] == sor[i+2] and sor[i+2] == sor[i+3]:
        print(sor[i]**2)
        ok = False
        break
    elif sor[i] == sor[i+1] and a == None:
        a = sor[i]
        
    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
1Accepted18ms3088 KiB
2Accepted17ms3104 KiB
3Accepted17ms3044 KiB
subtask20/10
4Accepted17ms3044 KiB
5Wrong answer17ms3044 KiB
6Accepted18ms2980 KiB
7Accepted17ms3192 KiB
8Accepted17ms3064 KiB
subtask30/10
9Wrong answer17ms3044 KiB
10Wrong answer18ms3044 KiB
11Accepted17ms3088 KiB
12Wrong answer17ms2972 KiB
13Accepted41ms4752 KiB
14Accepted46ms5028 KiB
subtask40/15
15Accepted17ms2964 KiB
16Accepted18ms3044 KiB
17Accepted17ms3220 KiB
18Accepted17ms3032 KiB
19Wrong answer17ms3088 KiB
20Accepted17ms2972 KiB
21Accepted17ms3192 KiB
22Wrong answer17ms3044 KiB
23Accepted17ms2916 KiB
24Wrong answer17ms2936 KiB
subtask50/20
25Wrong answer19ms3216 KiB
26Accepted21ms3712 KiB
27Wrong answer20ms3652 KiB
28Accepted24ms3552 KiB
29Accepted24ms3556 KiB
30Accepted21ms3560 KiB
31Accepted21ms3560 KiB
32Wrong answer20ms3704 KiB
subtask60/15
33Wrong answer17ms3088 KiB
34Accepted61ms14728 KiB
35Accepted136ms14740 KiB
36Accepted130ms14696 KiB
37Accepted101ms14696 KiB
38Accepted71ms14744 KiB
39Accepted59ms14824 KiB
40Accepted21ms4196 KiB
41Wrong answer61ms14624 KiB
subtask70/30
42Accepted86ms14236 KiB
43Accepted89ms14704 KiB
44Accepted172ms14700 KiB
45Accepted96ms14700 KiB
46Wrong answer89ms14852 KiB
47Accepted97ms14700 KiB
48Wrong answer90ms14864 KiB
49Accepted173ms14732 KiB
50Wrong answer82ms14624 KiB
51Wrong answer83ms14652 KiB