112732024-08-03 17:29:35probaLegnagyobb téglalappython3Time limit exceeded 55/1001.1s15036 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)
s, db = [], []
for i in sor:
    if i not in s and sor.count(i)>1:
        s += [i]
        db += [sor.count(i)]

#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
1Accepted17ms3044 KiB
2Accepted17ms3044 KiB
3Accepted17ms3044 KiB
subtask210/10
4Accepted17ms3096 KiB
5Accepted18ms3092 KiB
6Accepted17ms3064 KiB
7Accepted17ms2888 KiB
8Accepted17ms2916 KiB
subtask310/10
9Accepted17ms2964 KiB
10Accepted17ms2916 KiB
11Accepted18ms3064 KiB
12Accepted18ms2916 KiB
13Accepted45ms4840 KiB
14Accepted54ms4904 KiB
subtask415/15
15Accepted18ms2960 KiB
16Accepted17ms2996 KiB
17Accepted18ms3300 KiB
18Accepted17ms3064 KiB
19Accepted17ms2916 KiB
20Accepted17ms3044 KiB
21Accepted18ms2916 KiB
22Accepted17ms3044 KiB
23Accepted18ms3068 KiB
24Accepted17ms2928 KiB
subtask520/20
25Accepted63ms3172 KiB
26Accepted523ms3736 KiB
27Accepted523ms3556 KiB
28Accepted523ms3728 KiB
29Accepted523ms3556 KiB
30Accepted523ms3560 KiB
31Accepted523ms3848 KiB
32Accepted245ms3556 KiB
subtask60/15
33Accepted18ms2832 KiB
34Time limit exceeded1.093s14668 KiB
35Time limit exceeded1.095s14700 KiB
36Time limit exceeded1.093s14840 KiB
37Time limit exceeded1.098s14700 KiB
38Time limit exceeded1.097s14704 KiB
39Time limit exceeded1.095s14844 KiB
40Accepted23ms4344 KiB
41Time limit exceeded1.1s14624 KiB
subtask70/30
42Time limit exceeded1.093s14308 KiB
43Time limit exceeded1.093s14740 KiB
44Time limit exceeded1.093s14960 KiB
45Time limit exceeded1.093s14856 KiB
46Time limit exceeded1.095s14772 KiB
47Time limit exceeded1.095s14616 KiB
48Time limit exceeded1.095s14764 KiB
49Time limit exceeded1.097s14700 KiB
50Time limit exceeded1.097s14624 KiB
51Time limit exceeded1.098s15036 KiB