Submission #3197615


Source Code Expand

from collections import Counter
n = int(input())
a = Counter(map(int, input().split()))
ans = 0
b = [k for k, v in sorted(a.items()) if v >= 2]
for k, v in sorted(a.items(), reverse=True):
    if v >= 4:
        ans = k * k
if len(b) >= 2:
    ans = max(ans, b[-1] * b[-2])
print(ans)

Submission Info

Submission Time
Task C - Make a Rectangle
User poina
Language Python (3.4.3)
Score 0
Code Size 294 Byte
Status WA
Exec Time 290 ms
Memory 24104 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 3
AC × 12
WA × 3
Set Name Test Cases
Sample sample1.txt, sample2.txt, sample3.txt
All sample1.txt, sample2.txt, sample3.txt, 1.txt, 2.txt, 3.txt, 4.txt, 5.txt, 6.txt, 7.txt, 8.txt, 9.txt, sample1.txt, sample2.txt, sample3.txt
Case Name Status Exec Time Memory
1.txt AC 203 ms 18208 KB
2.txt AC 35 ms 7316 KB
3.txt AC 290 ms 24104 KB
4.txt AC 132 ms 15020 KB
5.txt WA 35 ms 7308 KB
6.txt AC 50 ms 11428 KB
7.txt WA 50 ms 11428 KB
8.txt WA 33 ms 6616 KB
9.txt AC 142 ms 13620 KB
sample1.txt AC 20 ms 3316 KB
sample2.txt AC 20 ms 3316 KB
sample3.txt AC 20 ms 3316 KB