11283 | 2024-08-03 21:02:52 | proba | Legnagyobb téglalap | python3 | Accepted 100/100 | 151ms | 14836 KiB |
#teglalap2
#N = 8; sor = list(map(int, '1 3 3 7 6 7 9 6'.split(' '))); sor.sort(reverse = True)
#N = 10; sor = list(map(int, '5 5 1 1 1 2 2 2 2 3 4'.split(' '))); sor.sort(reverse = True)
#N = 4; sor = list(map(int, '1000000 1000000 1000000 1000000'.split(' '))); sor.sort(reverse = True)
N = int(input()); sor = list(map(int, input().split(' '))); sor.sort(reverse = True)
#print(sor)
i, i1, ok = 0, None, True
while i < N and ok:
j = 1
while i+j < N and sor[i] == sor[i+j]:
j += 1
#print(j, end=' ')
if j > 3 and i1 == None:
print(sor[i]**2)
ok = False
elif j > 3 and i1 != None:
print(sor[i]*i1)
ok = False
elif j > 1:
if i1 == None:
i1 = sor[i]; i += j-1
else:
print(i1*sor[i]); ok = False
i += 1
if ok:
print(0)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 17ms | 3044 KiB | ||||
2 | Accepted | 17ms | 3064 KiB | ||||
3 | Accepted | 18ms | 3068 KiB | ||||
subtask2 | 10/10 | ||||||
4 | Accepted | 18ms | 3000 KiB | ||||
5 | Accepted | 18ms | 3044 KiB | ||||
6 | Accepted | 17ms | 2956 KiB | ||||
7 | Accepted | 17ms | 3176 KiB | ||||
8 | Accepted | 17ms | 2924 KiB | ||||
subtask3 | 10/10 | ||||||
9 | Accepted | 17ms | 2924 KiB | ||||
10 | Accepted | 17ms | 2976 KiB | ||||
11 | Accepted | 17ms | 3048 KiB | ||||
12 | Accepted | 17ms | 2960 KiB | ||||
13 | Accepted | 78ms | 4812 KiB | ||||
14 | Accepted | 61ms | 4884 KiB | ||||
subtask4 | 15/15 | ||||||
15 | Accepted | 17ms | 3044 KiB | ||||
16 | Accepted | 17ms | 3024 KiB | ||||
17 | Accepted | 17ms | 3112 KiB | ||||
18 | Accepted | 19ms | 3128 KiB | ||||
19 | Accepted | 17ms | 3048 KiB | ||||
20 | Accepted | 17ms | 3088 KiB | ||||
21 | Accepted | 18ms | 2888 KiB | ||||
22 | Accepted | 17ms | 3188 KiB | ||||
23 | Accepted | 17ms | 2960 KiB | ||||
24 | Accepted | 17ms | 2936 KiB | ||||
subtask5 | 20/20 | ||||||
25 | Accepted | 19ms | 3300 KiB | ||||
26 | Accepted | 20ms | 3484 KiB | ||||
27 | Accepted | 25ms | 3728 KiB | ||||
28 | Accepted | 21ms | 3592 KiB | ||||
29 | Accepted | 25ms | 3468 KiB | ||||
30 | Accepted | 21ms | 3656 KiB | ||||
31 | Accepted | 21ms | 3852 KiB | ||||
32 | Accepted | 20ms | 3712 KiB | ||||
subtask6 | 15/15 | ||||||
33 | Accepted | 18ms | 3312 KiB | ||||
34 | Accepted | 52ms | 14716 KiB | ||||
35 | Accepted | 114ms | 14748 KiB | ||||
36 | Accepted | 114ms | 14828 KiB | ||||
37 | Accepted | 83ms | 14652 KiB | ||||
38 | Accepted | 61ms | 14700 KiB | ||||
39 | Accepted | 48ms | 14748 KiB | ||||
40 | Accepted | 25ms | 4344 KiB | ||||
41 | Accepted | 54ms | 14772 KiB | ||||
subtask7 | 30/30 | ||||||
42 | Accepted | 76ms | 14400 KiB | ||||
43 | Accepted | 83ms | 14704 KiB | ||||
44 | Accepted | 151ms | 14768 KiB | ||||
45 | Accepted | 97ms | 14576 KiB | ||||
46 | Accepted | 86ms | 14636 KiB | ||||
47 | Accepted | 96ms | 14708 KiB | ||||
48 | Accepted | 82ms | 14708 KiB | ||||
49 | Accepted | 143ms | 14704 KiB | ||||
50 | Accepted | 79ms | 14624 KiB | ||||
51 | Accepted | 75ms | 14836 KiB |