111882024-07-15 20:39:38probaLegnagyobb téglalappython3Wrong answer 0/1001.1s14932 KiB
N = input()
sor = [int(i) for i in input().strip().split(' ')]

sor.sort(reverse=True)
h = len(sor)

i, a, b, ok = 0, None, None, True

  
while i < h-3 and h > 3:
    
    if sor.count(sor[i]) > 3:
        print(sor[i]**2)
        ok = False

    if sor[i] == sor[i+1] and a == None:
            a, j = sor[i], 1
            while i+j < h-3 and sor[i+j] == a:
                j += 1
            i += j+1
            #print(i, sor[i])
            if sor[i] == sor[i+1] and b == None:
                print(a*sor[i])
                ok = False
                break
    
    i += 1

if ok:
    print(0)

    
        
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer17ms3044 KiB
2Accepted17ms3044 KiB
3Wrong answer17ms3044 KiB
subtask20/10
4Wrong answer17ms3044 KiB
5Accepted17ms3044 KiB
6Accepted17ms3044 KiB
7Accepted17ms3088 KiB
8Accepted17ms3044 KiB
subtask30/10
9Accepted17ms3192 KiB
10Accepted17ms3044 KiB
11Wrong answer17ms3044 KiB
12Accepted17ms3044 KiB
13Wrong answer82ms4808 KiB
14Wrong answer70ms4924 KiB
subtask40/15
15Wrong answer18ms2952 KiB
16Wrong answer18ms3192 KiB
17Accepted18ms3084 KiB
18Accepted18ms2916 KiB
19Accepted18ms3044 KiB
20Accepted18ms3044 KiB
21Wrong answer17ms2876 KiB
22Wrong answer17ms3192 KiB
23Wrong answer17ms2992 KiB
24Accepted17ms2916 KiB
subtask50/20
25Accepted18ms3236 KiB
26Wrong answer526ms3496 KiB
27Accepted524ms3556 KiB
28Accepted524ms3656 KiB
29Wrong answer524ms3652 KiB
30Wrong answer523ms3560 KiB
31Wrong answer523ms3556 KiB
32Accepted19ms3556 KiB
subtask60/15
33Wrong answer17ms3044 KiB
34Time limit exceeded1.093s14932 KiB
35Time limit exceeded1.093s14700 KiB
36Time limit exceeded1.095s14700 KiB
37Time limit exceeded1.098s14848 KiB
38Time limit exceeded1.097s14736 KiB
39Time limit exceeded1.098s14700 KiB
40Wrong answer26ms4196 KiB
41Accepted61ms14624 KiB
subtask70/30
42Wrong answer83ms14384 KiB
43Time limit exceeded1.097s14700 KiB
44Time limit exceeded1.087s14732 KiB
45Time limit exceeded1.093s14704 KiB
46Time limit exceeded1.1s14700 KiB
47Time limit exceeded1.097s14824 KiB
48Time limit exceeded1.095s14828 KiB
49Time limit exceeded1.095s14848 KiB
50Accepted87ms14624 KiB
51Accepted87ms14524 KiB