111872024-07-15 20:36:08probaLegnagyobb téglalappython3Wrong answer 0/1001.098s15204 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
    else:
        if sor[i] == sor[i+1] and a == None:
            a, j = sor[i], 0
            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 answer17ms3088 KiB
2Wrong answer17ms2980 KiB
3Accepted17ms2964 KiB
subtask20/10
4Accepted18ms3216 KiB
5Wrong answer17ms3044 KiB
6Accepted17ms3192 KiB
7Accepted17ms3100 KiB
8Accepted17ms3044 KiB
subtask30/10
9Wrong answer18ms3192 KiB
10Wrong answer17ms3080 KiB
11Wrong answer18ms3108 KiB
12Wrong answer17ms3044 KiB
13Time limit exceeded1.097s5056 KiB
14Time limit exceeded1.098s4904 KiB
subtask40/15
15Wrong answer17ms3192 KiB
16Wrong answer18ms3176 KiB
17Accepted17ms3100 KiB
18Wrong answer18ms3192 KiB
19Wrong answer18ms3044 KiB
20Wrong answer18ms3044 KiB
21Wrong answer17ms3044 KiB
22Wrong answer17ms3180 KiB
23Wrong answer17ms2916 KiB
24Wrong answer18ms3228 KiB
subtask50/20
25Wrong answer18ms3196 KiB
26Wrong answer526ms3576 KiB
27Wrong answer523ms3728 KiB
28Wrong answer524ms3740 KiB
29Wrong answer523ms3576 KiB
30Wrong answer524ms3556 KiB
31Wrong answer524ms3684 KiB
32Wrong answer19ms3556 KiB
subtask60/15
33Wrong answer17ms3104 KiB
34Time limit exceeded1.093s15064 KiB
35Time limit exceeded1.093s14740 KiB
36Time limit exceeded1.092s14992 KiB
37Time limit exceeded1.098s14724 KiB
38Time limit exceeded1.098s14704 KiB
39Time limit exceeded1.097s14704 KiB
40Time limit exceeded1.097s4196 KiB
41Wrong answer61ms14688 KiB
subtask70/30
42Time limit exceeded1.095s14236 KiB
43Time limit exceeded1.093s14704 KiB
44Time limit exceeded1.092s14732 KiB
45Time limit exceeded1.093s14700 KiB
46Time limit exceeded1.087s14752 KiB
47Time limit exceeded1.098s14704 KiB
48Time limit exceeded1.087s14980 KiB
49Time limit exceeded1.088s15204 KiB
50Wrong answer82ms14880 KiB
51Wrong answer87ms14820 KiB