11282 | 2024-08-03 20:43:09 | proba | Legnagyobb téglalap | python3 | Wrong answer 10/100 | 158ms | 14852 KiB |
#teglalap2
#N = 8; sor = list(map(int, '1 3 3 7 6 7 9 6'.split(' '))); sor.sort(reverse = True)
#N = 8; sor = list(map(int, '5 5 1 1 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 | 18ms | 3044 KiB | ||||
2 | Accepted | 17ms | 3088 KiB | ||||
3 | Accepted | 17ms | 2916 KiB | ||||
subtask2 | 10/10 | ||||||
4 | Accepted | 18ms | 2952 KiB | ||||
5 | Accepted | 17ms | 2940 KiB | ||||
6 | Accepted | 17ms | 3048 KiB | ||||
7 | Accepted | 17ms | 3044 KiB | ||||
8 | Accepted | 17ms | 3064 KiB | ||||
subtask3 | 0/10 | ||||||
9 | Wrong answer | 17ms | 2916 KiB | ||||
10 | Wrong answer | 17ms | 3044 KiB | ||||
11 | Accepted | 18ms | 3172 KiB | ||||
12 | Wrong answer | 17ms | 3044 KiB | ||||
13 | Accepted | 79ms | 4884 KiB | ||||
14 | Accepted | 61ms | 4884 KiB | ||||
subtask4 | 0/15 | ||||||
15 | Accepted | 17ms | 2916 KiB | ||||
16 | Accepted | 17ms | 3048 KiB | ||||
17 | Accepted | 17ms | 3044 KiB | ||||
18 | Accepted | 17ms | 2916 KiB | ||||
19 | Accepted | 17ms | 3044 KiB | ||||
20 | Accepted | 17ms | 3044 KiB | ||||
21 | Accepted | 17ms | 3192 KiB | ||||
22 | Accepted | 17ms | 3044 KiB | ||||
23 | Accepted | 17ms | 3044 KiB | ||||
24 | Wrong answer | 17ms | 3044 KiB | ||||
subtask5 | 0/20 | ||||||
25 | Wrong answer | 18ms | 3172 KiB | ||||
26 | Accepted | 20ms | 3512 KiB | ||||
27 | Accepted | 24ms | 3600 KiB | ||||
28 | Accepted | 23ms | 3684 KiB | ||||
29 | Accepted | 25ms | 3524 KiB | ||||
30 | Accepted | 20ms | 3556 KiB | ||||
31 | Accepted | 21ms | 3408 KiB | ||||
32 | Wrong answer | 20ms | 3728 KiB | ||||
subtask6 | 0/15 | ||||||
33 | Accepted | 17ms | 3088 KiB | ||||
34 | Accepted | 50ms | 14804 KiB | ||||
35 | Accepted | 119ms | 14700 KiB | ||||
36 | Accepted | 108ms | 14704 KiB | ||||
37 | Accepted | 90ms | 14748 KiB | ||||
38 | Accepted | 63ms | 14852 KiB | ||||
39 | Accepted | 50ms | 14744 KiB | ||||
40 | Accepted | 25ms | 4160 KiB | ||||
41 | Wrong answer | 50ms | 14624 KiB | ||||
subtask7 | 0/30 | ||||||
42 | Accepted | 72ms | 14252 KiB | ||||
43 | Accepted | 75ms | 14832 KiB | ||||
44 | Accepted | 141ms | 14704 KiB | ||||
45 | Accepted | 86ms | 14724 KiB | ||||
46 | Accepted | 85ms | 14744 KiB | ||||
47 | Accepted | 92ms | 14704 KiB | ||||
48 | Accepted | 82ms | 14704 KiB | ||||
49 | Accepted | 158ms | 14700 KiB | ||||
50 | Wrong answer | 75ms | 14772 KiB | ||||
51 | Wrong answer | 76ms | 14696 KiB |