11284 | 2024-08-03 21:05:40 | proba | Legnagyobb téglalap | python3 | Accepted 100/100 | 148ms | 14852 KiB |
N = int(input()); sor = list(map(int, input().split(' '))); sor.sort(reverse = True)
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
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 | 3044 KiB | ||||
3 | Accepted | 17ms | 3048 KiB | ||||
subtask2 | 10/10 | ||||||
4 | Accepted | 17ms | 3048 KiB | ||||
5 | Accepted | 17ms | 3044 KiB | ||||
6 | Accepted | 18ms | 3060 KiB | ||||
7 | Accepted | 17ms | 3092 KiB | ||||
8 | Accepted | 17ms | 2972 KiB | ||||
subtask3 | 10/10 | ||||||
9 | Accepted | 17ms | 2916 KiB | ||||
10 | Accepted | 17ms | 3044 KiB | ||||
11 | Accepted | 17ms | 3100 KiB | ||||
12 | Accepted | 17ms | 3044 KiB | ||||
13 | Accepted | 78ms | 4884 KiB | ||||
14 | Accepted | 63ms | 4884 KiB | ||||
subtask4 | 15/15 | ||||||
15 | Accepted | 18ms | 3192 KiB | ||||
16 | Accepted | 18ms | 2948 KiB | ||||
17 | Accepted | 17ms | 3220 KiB | ||||
18 | Accepted | 17ms | 3044 KiB | ||||
19 | Accepted | 18ms | 3044 KiB | ||||
20 | Accepted | 17ms | 3044 KiB | ||||
21 | Accepted | 17ms | 3044 KiB | ||||
22 | Accepted | 17ms | 3044 KiB | ||||
23 | Accepted | 17ms | 2840 KiB | ||||
24 | Accepted | 17ms | 3044 KiB | ||||
subtask5 | 20/20 | ||||||
25 | Accepted | 18ms | 3160 KiB | ||||
26 | Accepted | 20ms | 3556 KiB | ||||
27 | Accepted | 24ms | 3680 KiB | ||||
28 | Accepted | 21ms | 3856 KiB | ||||
29 | Accepted | 24ms | 3428 KiB | ||||
30 | Accepted | 20ms | 3556 KiB | ||||
31 | Accepted | 21ms | 3692 KiB | ||||
32 | Accepted | 19ms | 3696 KiB | ||||
subtask6 | 15/15 | ||||||
33 | Accepted | 18ms | 2916 KiB | ||||
34 | Accepted | 54ms | 14720 KiB | ||||
35 | Accepted | 112ms | 14832 KiB | ||||
36 | Accepted | 109ms | 14704 KiB | ||||
37 | Accepted | 87ms | 14704 KiB | ||||
38 | Accepted | 57ms | 14704 KiB | ||||
39 | Accepted | 48ms | 14704 KiB | ||||
40 | Accepted | 25ms | 4196 KiB | ||||
41 | Accepted | 52ms | 14624 KiB | ||||
subtask7 | 30/30 | ||||||
42 | Accepted | 71ms | 14260 KiB | ||||
43 | Accepted | 81ms | 14708 KiB | ||||
44 | Accepted | 148ms | 14832 KiB | ||||
45 | Accepted | 87ms | 14852 KiB | ||||
46 | Accepted | 92ms | 14768 KiB | ||||
47 | Accepted | 90ms | 14740 KiB | ||||
48 | Accepted | 82ms | 14700 KiB | ||||
49 | Accepted | 146ms | 14760 KiB | ||||
50 | Accepted | 81ms | 14620 KiB | ||||
51 | Accepted | 79ms | 14824 KiB |