112752024-08-03 17:43:35probaLegnagyobb téglalappython3Time limit exceeded 55/1001.1s14972 KiB
#N = 8; sor = list(map(int, '1 3 3 7 6 7 9 6'.split(' ')))
N = int(input()); sor = list(map(int, input().split(' ')))
sor.sort(reverse=True)
#print(sor)
s, db = [], []

i = 0
while i < len(sor) and len(db) < 3:
    if sor[i] not in s and sor.count(sor[i])>1:
        s += [sor[i]]
        db += [sor.count(sor[i])]
    i += 1

#print(s, db)
if len(db) == 0 or (len(db) == 1 and db[0] < 4):
    print(0)
elif db[0] > 3:
    print(s[0]**2)
else:
    print(s[0]*s[1])
    
    
    
    
    
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms2988 KiB
2Accepted17ms3044 KiB
3Accepted17ms3044 KiB
subtask210/10
4Accepted17ms3224 KiB
5Accepted17ms2952 KiB
6Accepted17ms3044 KiB
7Accepted17ms3048 KiB
8Accepted17ms2936 KiB
subtask310/10
9Accepted17ms3180 KiB
10Accepted17ms2960 KiB
11Accepted17ms2864 KiB
12Accepted18ms3044 KiB
13Accepted82ms5052 KiB
14Accepted90ms4896 KiB
subtask415/15
15Accepted18ms3100 KiB
16Accepted17ms3192 KiB
17Accepted17ms3180 KiB
18Accepted17ms2988 KiB
19Accepted18ms3044 KiB
20Accepted17ms3108 KiB
21Accepted18ms3088 KiB
22Accepted17ms3044 KiB
23Accepted18ms3044 KiB
24Accepted17ms3044 KiB
subtask520/20
25Accepted19ms3288 KiB
26Accepted85ms3716 KiB
27Accepted526ms3472 KiB
28Accepted524ms3556 KiB
29Accepted526ms3696 KiB
30Accepted524ms3556 KiB
31Accepted317ms3556 KiB
32Accepted20ms3556 KiB
subtask60/15
33Accepted18ms3044 KiB
34Accepted74ms14664 KiB
35Time limit exceeded1.09s14700 KiB
36Time limit exceeded1.093s14972 KiB
37Time limit exceeded1.097s14700 KiB
38Time limit exceeded1.098s14700 KiB
39Time limit exceeded1.098s14700 KiB
40Accepted27ms4196 KiB
41Accepted68ms14620 KiB
subtask70/30
42Accepted90ms14108 KiB
43Accepted189ms14844 KiB
44Time limit exceeded1.093s14700 KiB
45Time limit exceeded1.09s14700 KiB
46Time limit exceeded1.1s14700 KiB
47Time limit exceeded1.1s14700 KiB
48Time limit exceeded1.098s14700 KiB
49Time limit exceeded1.095s14832 KiB
50Accepted92ms14628 KiB
51Accepted92ms14648 KiB