111812024-07-15 18:40:23probaLegnagyobb téglalappython3Wrong answer 0/100165ms14848 KiB
N = input()
sor = [int(i) for i in input().split(' ')]

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


while i < h-2:
    
    if sor[i] == sor[i+1] and sor[i+1] == sor[i+2] and sor[i+2] == sor[i+3]:
        print(sor[i]**2)
        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])
        break
    i += 1

if i == h-2:
    print(0)

    
        
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms3044 KiB
2Accepted17ms3096 KiB
3Accepted17ms2952 KiB
subtask20/10
4Accepted17ms3044 KiB
5Wrong answer18ms2968 KiB
6Runtime error17ms3060 KiB
7Accepted17ms3044 KiB
8Accepted17ms2916 KiB
subtask30/10
9Wrong answer18ms2972 KiB
10Wrong answer17ms2984 KiB
11Accepted18ms3208 KiB
12Wrong answer17ms3092 KiB
13Accepted43ms5028 KiB
14Accepted46ms4924 KiB
subtask40/15
15Accepted17ms3064 KiB
16Accepted17ms3100 KiB
17Accepted17ms3180 KiB
18Accepted17ms3056 KiB
19Wrong answer18ms3080 KiB
20Accepted17ms3044 KiB
21Accepted17ms3044 KiB
22Wrong answer17ms3044 KiB
23Accepted17ms3044 KiB
24Wrong answer17ms3044 KiB
subtask50/20
25Wrong answer19ms3164 KiB
26Accepted20ms3640 KiB
27Wrong answer21ms3620 KiB
28Accepted25ms3812 KiB
29Accepted25ms3444 KiB
30Accepted21ms3516 KiB
31Accepted21ms3704 KiB
32Wrong answer19ms3572 KiB
subtask60/15
33Wrong answer17ms3044 KiB
34Accepted61ms14796 KiB
35Accepted128ms14768 KiB
36Accepted128ms14692 KiB
37Accepted101ms14848 KiB
38Accepted68ms14720 KiB
39Accepted54ms14752 KiB
40Accepted21ms4340 KiB
41Wrong answer59ms14624 KiB
subtask70/30
42Accepted78ms14276 KiB
43Accepted86ms14700 KiB
44Accepted165ms14832 KiB
45Accepted96ms14744 KiB
46Wrong answer93ms14840 KiB
47Accepted104ms14704 KiB
48Wrong answer82ms14700 KiB
49Accepted160ms14824 KiB
50Wrong answer82ms14812 KiB
51Wrong answer83ms14520 KiB