112812024-08-03 20:43:09probaLegnagyobb téglalappython3Wrong answer 10/100158ms14876 KiB
#teglalap2
#N = 8; sor = list(map(int, '1 3 3 7 6 7 9 6'.split(' '))); sor.sort(reverse = True)
#N = 8; sor = list(map(int, '5 5 1 1 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
1Accepted17ms3044 KiB
2Accepted17ms2960 KiB
3Accepted17ms3192 KiB
subtask210/10
4Accepted17ms3044 KiB
5Accepted17ms2828 KiB
6Accepted17ms3064 KiB
7Accepted17ms3044 KiB
8Accepted17ms2844 KiB
subtask30/10
9Wrong answer17ms2992 KiB
10Wrong answer17ms3044 KiB
11Accepted17ms3172 KiB
12Wrong answer17ms3044 KiB
13Accepted78ms4832 KiB
14Accepted59ms4916 KiB
subtask40/15
15Accepted17ms3044 KiB
16Accepted17ms2964 KiB
17Accepted17ms3044 KiB
18Accepted17ms3040 KiB
19Accepted17ms3044 KiB
20Accepted17ms3056 KiB
21Accepted17ms3044 KiB
22Accepted17ms3048 KiB
23Accepted17ms3044 KiB
24Wrong answer17ms3044 KiB
subtask50/20
25Wrong answer18ms3308 KiB
26Accepted20ms3428 KiB
27Accepted24ms3684 KiB
28Accepted21ms3580 KiB
29Accepted23ms3556 KiB
30Accepted20ms3684 KiB
31Accepted21ms3692 KiB
32Wrong answer19ms3556 KiB
subtask60/15
33Accepted17ms2844 KiB
34Accepted50ms14640 KiB
35Accepted112ms14656 KiB
36Accepted112ms14852 KiB
37Accepted86ms14700 KiB
38Accepted61ms14704 KiB
39Accepted52ms14700 KiB
40Accepted26ms4196 KiB
41Wrong answer50ms14624 KiB
subtask70/30
42Accepted76ms14280 KiB
43Accepted79ms14700 KiB
44Accepted158ms14752 KiB
45Accepted92ms14700 KiB
46Accepted90ms14876 KiB
47Accepted94ms14876 KiB
48Accepted82ms14704 KiB
49Accepted145ms14704 KiB
50Wrong answer76ms14628 KiB
51Wrong answer81ms14732 KiB