11280 | 2024-08-03 20:39:16 | proba | Legnagyobb téglalap | python3 | Wrong answer 10/100 | 152ms | 14880 KiB |
#teglalap2
#N = 8; sor = list(map(int, '1 3 3 7 6 7 9 6'.split(' '))); sor.sort(reverse = True)
#N = 6; sor = list(map(int, '5 5 1 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:
print(sor[i]**2)
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 | 3172 KiB | ||||
2 | Accepted | 18ms | 3044 KiB | ||||
3 | Accepted | 17ms | 2972 KiB | ||||
subtask2 | 10/10 | ||||||
4 | Accepted | 17ms | 3044 KiB | ||||
5 | Accepted | 17ms | 2952 KiB | ||||
6 | Accepted | 17ms | 3044 KiB | ||||
7 | Accepted | 17ms | 3216 KiB | ||||
8 | Accepted | 17ms | 2916 KiB | ||||
subtask3 | 0/10 | ||||||
9 | Wrong answer | 17ms | 3080 KiB | ||||
10 | Wrong answer | 18ms | 2944 KiB | ||||
11 | Accepted | 17ms | 2984 KiB | ||||
12 | Wrong answer | 17ms | 3088 KiB | ||||
13 | Accepted | 78ms | 4884 KiB | ||||
14 | Accepted | 64ms | 4928 KiB | ||||
subtask4 | 0/15 | ||||||
15 | Accepted | 17ms | 3192 KiB | ||||
16 | Accepted | 18ms | 3044 KiB | ||||
17 | Accepted | 17ms | 3028 KiB | ||||
18 | Accepted | 17ms | 3044 KiB | ||||
19 | Accepted | 17ms | 3044 KiB | ||||
20 | Accepted | 17ms | 3192 KiB | ||||
21 | Accepted | 17ms | 3040 KiB | ||||
22 | Accepted | 17ms | 3192 KiB | ||||
23 | Accepted | 17ms | 3192 KiB | ||||
24 | Wrong answer | 18ms | 3044 KiB | ||||
subtask5 | 0/20 | ||||||
25 | Wrong answer | 18ms | 3196 KiB | ||||
26 | Accepted | 21ms | 3716 KiB | ||||
27 | Accepted | 24ms | 3728 KiB | ||||
28 | Accepted | 21ms | 3556 KiB | ||||
29 | Accepted | 24ms | 3588 KiB | ||||
30 | Accepted | 20ms | 3556 KiB | ||||
31 | Accepted | 21ms | 3544 KiB | ||||
32 | Wrong answer | 19ms | 3484 KiB | ||||
subtask6 | 0/15 | ||||||
33 | Accepted | 18ms | 2980 KiB | ||||
34 | Accepted | 56ms | 14880 KiB | ||||
35 | Accepted | 116ms | 14760 KiB | ||||
36 | Accepted | 112ms | 14768 KiB | ||||
37 | Accepted | 82ms | 14704 KiB | ||||
38 | Accepted | 59ms | 14836 KiB | ||||
39 | Accepted | 50ms | 14704 KiB | ||||
40 | Accepted | 25ms | 4344 KiB | ||||
41 | Wrong answer | 52ms | 14556 KiB | ||||
subtask7 | 0/30 | ||||||
42 | Accepted | 71ms | 14236 KiB | ||||
43 | Accepted | 76ms | 14704 KiB | ||||
44 | Accepted | 152ms | 14692 KiB | ||||
45 | Accepted | 87ms | 14700 KiB | ||||
46 | Accepted | 86ms | 14832 KiB | ||||
47 | Accepted | 92ms | 14700 KiB | ||||
48 | Accepted | 78ms | 14848 KiB | ||||
49 | Accepted | 142ms | 14748 KiB | ||||
50 | Wrong answer | 81ms | 14660 KiB | ||||
51 | Wrong answer | 75ms | 14696 KiB |