112802024-08-03 20:39:16probaLegnagyobb téglalappython3Wrong answer 10/100152ms14880 KiB
#teglalap2
#N = 8; sor = list(map(int, '1 3 3 7 6 7 9 6'.split(' '))); sor.sort(reverse = True)
#N = 6; sor = list(map(int, '5 5 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
1Accepted17ms3172 KiB
2Accepted18ms3044 KiB
3Accepted17ms2972 KiB
subtask210/10
4Accepted17ms3044 KiB
5Accepted17ms2952 KiB
6Accepted17ms3044 KiB
7Accepted17ms3216 KiB
8Accepted17ms2916 KiB
subtask30/10
9Wrong answer17ms3080 KiB
10Wrong answer18ms2944 KiB
11Accepted17ms2984 KiB
12Wrong answer17ms3088 KiB
13Accepted78ms4884 KiB
14Accepted64ms4928 KiB
subtask40/15
15Accepted17ms3192 KiB
16Accepted18ms3044 KiB
17Accepted17ms3028 KiB
18Accepted17ms3044 KiB
19Accepted17ms3044 KiB
20Accepted17ms3192 KiB
21Accepted17ms3040 KiB
22Accepted17ms3192 KiB
23Accepted17ms3192 KiB
24Wrong answer18ms3044 KiB
subtask50/20
25Wrong answer18ms3196 KiB
26Accepted21ms3716 KiB
27Accepted24ms3728 KiB
28Accepted21ms3556 KiB
29Accepted24ms3588 KiB
30Accepted20ms3556 KiB
31Accepted21ms3544 KiB
32Wrong answer19ms3484 KiB
subtask60/15
33Accepted18ms2980 KiB
34Accepted56ms14880 KiB
35Accepted116ms14760 KiB
36Accepted112ms14768 KiB
37Accepted82ms14704 KiB
38Accepted59ms14836 KiB
39Accepted50ms14704 KiB
40Accepted25ms4344 KiB
41Wrong answer52ms14556 KiB
subtask70/30
42Accepted71ms14236 KiB
43Accepted76ms14704 KiB
44Accepted152ms14692 KiB
45Accepted87ms14700 KiB
46Accepted86ms14832 KiB
47Accepted92ms14700 KiB
48Accepted78ms14848 KiB
49Accepted142ms14748 KiB
50Wrong answer81ms14660 KiB
51Wrong answer75ms14696 KiB