112742024-08-03 17:42:46probaLegnagyobb téglalappython3Wrong answer 0/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)
#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(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
1Accepted17ms3044 KiB
2Accepted17ms3064 KiB
3Wrong answer17ms3120 KiB
subtask20/10
4Wrong answer18ms2968 KiB
5Accepted17ms2844 KiB
6Accepted17ms2976 KiB
7Accepted17ms2916 KiB
8Accepted17ms3064 KiB
subtask30/10
9Accepted17ms3044 KiB
10Accepted17ms3044 KiB
11Accepted17ms2972 KiB
12Accepted17ms3192 KiB
13Wrong answer82ms4880 KiB
14Wrong answer92ms4880 KiB
subtask40/15
15Accepted18ms3044 KiB
16Accepted17ms2972 KiB
17Accepted18ms3188 KiB
18Accepted17ms3044 KiB
19Accepted17ms2844 KiB
20Wrong answer17ms3088 KiB
21Accepted17ms2916 KiB
22Accepted17ms3064 KiB
23Wrong answer17ms2916 KiB
24Wrong answer17ms3044 KiB
subtask50/20
25Accepted19ms3044 KiB
26Accepted85ms3688 KiB
27Accepted524ms3624 KiB
28Wrong answer524ms3696 KiB
29Accepted524ms3556 KiB
30Wrong answer526ms3556 KiB
31Accepted317ms3556 KiB
32Accepted19ms3368 KiB
subtask60/15
33Accepted17ms3044 KiB
34Accepted71ms14816 KiB
35Time limit exceeded1.093s14844 KiB
36Time limit exceeded1.095s14876 KiB
37Time limit exceeded1.1s14716 KiB
38Time limit exceeded1.098s14704 KiB
39Time limit exceeded1.098s14704 KiB
40Wrong answer27ms4200 KiB
41Accepted64ms14624 KiB
subtask70/30
42Wrong answer85ms14272 KiB
43Accepted187ms14704 KiB
44Time limit exceeded1.095s14704 KiB
45Time limit exceeded1.092s14844 KiB
46Time limit exceeded1.098s14704 KiB
47Time limit exceeded1.095s14852 KiB
48Time limit exceeded1.098s14700 KiB
49Time limit exceeded1.098s14704 KiB
50Accepted92ms14624 KiB
51Accepted93ms15036 KiB