111792024-07-15 16:31:14probaLegnagyobb téglalappython3Wrong answer 0/1001.1s14988 KiB
N = int(input())
sor = [int(i) for i in input().split(' ')]
sor.sort(reverse=True)

i = 0
a, b = 0, 0
while i < len(sor):
    if sor.count(sor[i]) > 3:
        print(sor[i]**2)
        break
    
    elif sor.count(sor[i]) > 1:
        if a == 0:
            a = sor[i]
        elif b == 0:
            b = sor[i]
            break
        while i < len(sor) and sor[i] == a:
            i += 1
    else:
        i += 1
    
if a*b != 0:
    print(a*b)
else:
    print(0)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted18ms3048 KiB
2Accepted17ms3044 KiB
3Wrong answer17ms2968 KiB
subtask20/10
4Wrong answer17ms2960 KiB
5Accepted18ms2976 KiB
6Accepted17ms3064 KiB
7Accepted17ms3044 KiB
8Accepted17ms2912 KiB
subtask30/10
9Wrong answer17ms2916 KiB
10Wrong answer17ms3192 KiB
11Wrong answer17ms3172 KiB
12Wrong answer17ms3044 KiB
13Wrong answer41ms4880 KiB
14Wrong answer48ms5028 KiB
subtask40/15
15Accepted18ms3188 KiB
16Accepted17ms3096 KiB
17Accepted18ms3172 KiB
18Accepted18ms3044 KiB
19Accepted18ms2944 KiB
20Wrong answer18ms3172 KiB
21Accepted17ms3044 KiB
22Accepted17ms3192 KiB
23Wrong answer17ms2912 KiB
24Wrong answer17ms3192 KiB
subtask50/20
25Wrong answer19ms3448 KiB
26Accepted138ms3664 KiB
27Time limit exceeded1.026s3560 KiB
28Wrong answer495ms3556 KiB
29Time limit exceeded1.006s3556 KiB
30Wrong answer164ms3684 KiB
31Accepted456ms3556 KiB
32Wrong answer19ms3556 KiB
subtask60/15
33Accepted17ms3088 KiB
34Accepted76ms14672 KiB
35Time limit exceeded1.092s14700 KiB
36Time limit exceeded1.095s14840 KiB
37Time limit exceeded1.1s14572 KiB
38Time limit exceeded1.098s14700 KiB
39Time limit exceeded1.098s14732 KiB
40Wrong answer20ms4340 KiB
41Wrong answer71ms14624 KiB
subtask70/30
42Wrong answer79ms14168 KiB
43Accepted238ms14756 KiB
44Time limit exceeded1.09s14876 KiB
45Time limit exceeded1.09s14988 KiB
46Time limit exceeded1.098s14700 KiB
47Time limit exceeded1.098s14700 KiB
48Time limit exceeded1.098s14848 KiB
49Time limit exceeded1.098s14700 KiB
50Wrong answer92ms14624 KiB
51Wrong answer87ms14520 KiB