Submission #3456517
Source Code Expand
#include <bits/stdc++.h> using namespace std; int main() { long long N,s,count; s=1; count=0; cin >> N; vector<long long> A(N); for(long long i=0;i<N;i++){cin >> A[i];} sort(A.begin(), A.end()); for(long long i=N-1;i>=0;i--){ if(A[i-1]==A[i]){ count++; s*=A[i]; i--; } if(count==2){ cout << s << endl; return 0; } } cout << 0 << endl; }
Submission Info
Submission Time | |
---|---|
Task | C - Make a Rectangle |
User | iruka |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 428 Byte |
Status | AC |
Exec Time | 46 ms |
Memory | 1024 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 | 46 ms | 1024 KB |
2.txt | AC | 22 ms | 640 KB |
3.txt | AC | 46 ms | 1024 KB |
4.txt | AC | 46 ms | 1024 KB |
5.txt | AC | 22 ms | 640 KB |
6.txt | AC | 43 ms | 1024 KB |
7.txt | AC | 43 ms | 1024 KB |
8.txt | AC | 18 ms | 512 KB |
9.txt | AC | 24 ms | 640 KB |
sample1.txt | AC | 1 ms | 256 KB |
sample2.txt | AC | 1 ms | 256 KB |
sample3.txt | AC | 1 ms | 256 KB |