111732024-07-08 12:40:56probaLegnagyobb téglalappython3Wrong answer 0/1001.097s17976 KiB
# rudak
N = input()
rudak =[int(i) for i in input().split(' ')]
H = set()
for i in rudak:
    H.add(i)
D = []
for i in list(H):
    if rudak.count(i) > 1:
        D += [[i, rudak.count(i)]]
sor = sorted(D, key = lambda x: x[1])
if len(D)==0 or (len(D) == 1 and D[0][1] < 4):
    print(0)
elif len(D) == 1 and D[0][1] >3:
    print(D[0][1]**2)
elif D[-1][1] > 3:
    print(D[-1][0]**2)
else:
    print(D[-1][0]*D[-2][0])
    
    
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms3044 KiB
2Accepted18ms3044 KiB
3Wrong answer17ms3044 KiB
subtask20/10
4Wrong answer17ms3044 KiB
5Accepted17ms3044 KiB
6Accepted17ms3196 KiB
7Accepted17ms3196 KiB
8Accepted17ms3044 KiB
subtask30/10
9Accepted18ms3044 KiB
10Accepted17ms3044 KiB
11Wrong answer17ms3104 KiB
12Accepted17ms3104 KiB
13Wrong answer52ms5064 KiB
14Accepted59ms5012 KiB
subtask40/15
15Accepted17ms3068 KiB
16Wrong answer18ms2992 KiB
17Accepted17ms2952 KiB
18Accepted17ms3044 KiB
19Accepted17ms3044 KiB
20Wrong answer17ms3080 KiB
21Accepted17ms3192 KiB
22Accepted18ms3044 KiB
23Accepted17ms2960 KiB
24Accepted17ms2916 KiB
subtask50/20
25Accepted57ms3300 KiB
26Wrong answer524ms4324 KiB
27Accepted523ms4476 KiB
28Wrong answer523ms4232 KiB
29Accepted523ms4324 KiB
30Accepted523ms4328 KiB
31Wrong answer523ms4196 KiB
32Accepted216ms3556 KiB
subtask60/15
33Accepted17ms3104 KiB
34Time limit exceeded1.093s15488 KiB
35Time limit exceeded1.088s16776 KiB
36Time limit exceeded1.088s16808 KiB
37Time limit exceeded1.097s16668 KiB
38Time limit exceeded1.097s16676 KiB
39Time limit exceeded1.095s16736 KiB
40Wrong answer24ms4324 KiB
41Time limit exceeded1.097s15264 KiB
subtask70/30
42Time limit exceeded1.095s14744 KiB
43Time limit exceeded1.088s16616 KiB
44Time limit exceeded1.087s16728 KiB
45Time limit exceeded1.085s16852 KiB
46Time limit exceeded1.09s16928 KiB
47Time limit exceeded1.085s16812 KiB
48Time limit exceeded1.085s17700 KiB
49Time limit exceeded1.093s17976 KiB
50Time limit exceeded1.095s15260 KiB
51Time limit exceeded1.095s15312 KiB