Submission #3454465
Source Code Expand
from collections import defaultdict N = int(input()) A = [int(i) for i in input().split()] L = defaultdict(int) for a in A: L[a] += 1 Lkey = sorted(L, reverse = True) for i in range(len(Lkey)): if L[Lkey[i]] >= 4: print(Lkey[i]**2) break elif L[Lkey[i]] >= 2: for j in range(i+1, len(Lkey)): if L[Lkey[j]] >= 2: print(Lkey[i] * Lkey[j]) break break else: print(0)
Submission Info
Submission Time | |
---|---|
Task | C - Make a Rectangle |
User | earlgrey_yh |
Language | Python (3.4.3) |
Score | 300 |
Code Size | 477 Byte |
Status | AC |
Exec Time | 147 ms |
Memory | 18600 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
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 | 108 ms | 14636 KB |
2.txt | AC | 43 ms | 8872 KB |
3.txt | AC | 147 ms | 18600 KB |
4.txt | AC | 87 ms | 14508 KB |
5.txt | AC | 42 ms | 8972 KB |
6.txt | AC | 64 ms | 14628 KB |
7.txt | AC | 63 ms | 14628 KB |
8.txt | AC | 37 ms | 7756 KB |
9.txt | AC | 84 ms | 11064 KB |
sample1.txt | AC | 20 ms | 3316 KB |
sample2.txt | AC | 20 ms | 3316 KB |
sample3.txt | AC | 20 ms | 3316 KB |