11569 | 2024-10-27 01:55:50 | balint | Legnagyobb téglalap | python3 | Accepted 100/100 | 83ms | 22264 KiB |
from collections import Counter
import sys
def main():
nums = sorted([(num, count) for num, count in Counter(map(int, sys.stdin.read().splitlines()[1].split())).items() if count > 1], reverse=True, key= lambda x: x[0])
if len(nums) == 0:
print(0)
elif len(nums) == 1:
print(nums[0][0]**2 if nums[0][1] >= 4 else 0)
else:
if nums[0][1] >= 4:
print(nums[0][0] **2)
else:
print(nums[0][0] * nums[1][0])
main()
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 17ms | 3380 KiB | ||||
2 | Accepted | 19ms | 3384 KiB | ||||
3 | Accepted | 18ms | 3384 KiB | ||||
subtask2 | 10/10 | ||||||
4 | Accepted | 20ms | 3384 KiB | ||||
5 | Accepted | 20ms | 3532 KiB | ||||
6 | Accepted | 18ms | 3388 KiB | ||||
7 | Accepted | 19ms | 3640 KiB | ||||
8 | Accepted | 18ms | 3384 KiB | ||||
subtask3 | 10/10 | ||||||
9 | Accepted | 18ms | 3504 KiB | ||||
10 | Accepted | 18ms | 3384 KiB | ||||
11 | Accepted | 18ms | 3412 KiB | ||||
12 | Accepted | 18ms | 3576 KiB | ||||
13 | Accepted | 39ms | 4848 KiB | ||||
14 | Accepted | 39ms | 4676 KiB | ||||
subtask4 | 15/15 | ||||||
15 | Accepted | 19ms | 3384 KiB | ||||
16 | Accepted | 18ms | 3384 KiB | ||||
17 | Accepted | 18ms | 3384 KiB | ||||
18 | Accepted | 18ms | 3500 KiB | ||||
19 | Accepted | 18ms | 3520 KiB | ||||
20 | Accepted | 18ms | 3532 KiB | ||||
21 | Accepted | 18ms | 3712 KiB | ||||
22 | Accepted | 17ms | 3552 KiB | ||||
23 | Accepted | 17ms | 3468 KiB | ||||
24 | Accepted | 18ms | 3456 KiB | ||||
subtask5 | 20/20 | ||||||
25 | Accepted | 19ms | 3644 KiB | ||||
26 | Accepted | 20ms | 4284 KiB | ||||
27 | Accepted | 21ms | 4256 KiB | ||||
28 | Accepted | 20ms | 4144 KiB | ||||
29 | Accepted | 21ms | 4220 KiB | ||||
30 | Accepted | 21ms | 4152 KiB | ||||
31 | Accepted | 23ms | 4152 KiB | ||||
32 | Accepted | 20ms | 3896 KiB | ||||
subtask6 | 15/15 | ||||||
33 | Accepted | 19ms | 3576 KiB | ||||
34 | Accepted | 68ms | 16884 KiB | ||||
35 | Accepted | 82ms | 22100 KiB | ||||
36 | Accepted | 75ms | 22264 KiB | ||||
37 | Accepted | 82ms | 22132 KiB | ||||
38 | Accepted | 75ms | 22248 KiB | ||||
39 | Accepted | 68ms | 22248 KiB | ||||
40 | Accepted | 23ms | 4192 KiB | ||||
41 | Accepted | 59ms | 12408 KiB | ||||
subtask7 | 30/30 | ||||||
42 | Accepted | 57ms | 11096 KiB | ||||
43 | Accepted | 75ms | 22076 KiB | ||||
44 | Accepted | 82ms | 22244 KiB | ||||
45 | Accepted | 76ms | 22152 KiB | ||||
46 | Accepted | 75ms | 22092 KiB | ||||
47 | Accepted | 83ms | 22108 KiB | ||||
48 | Accepted | 76ms | 22200 KiB | ||||
49 | Accepted | 76ms | 22148 KiB | ||||
50 | Accepted | 67ms | 12556 KiB | ||||
51 | Accepted | 75ms | 13892 KiB |