Submission #2863405
Source Code Expand
#include <iostream> #include <algorithm> #include <vector> using namespace std; int n; vector <int> tab; int main() { cin >> n; int a; int s1; bool f = false ; for(int i = 1; i <= n ; i++){ cin >> a; tab.push_back(a); } sort(tab.begin(),tab.end()); int i = n; while( i > 1){ i--; if(tab[i] == tab[i-1]){ if(f){ cout << s1 * tab[i] ; return 0; }else{ f = true; s1 = tab[i]; } i--; } } cout << 0 ; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Make a Rectangle |
User | SITOOH |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 639 Byte |
Status | WA |
Exec Time | 60 ms |
Memory | 892 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | WA | 59 ms | 892 KB |
2.txt | WA | 29 ms | 640 KB |
3.txt | WA | 60 ms | 892 KB |
4.txt | WA | 60 ms | 892 KB |
5.txt | WA | 29 ms | 640 KB |
6.txt | WA | 57 ms | 892 KB |
7.txt | WA | 56 ms | 892 KB |
8.txt | WA | 24 ms | 640 KB |
9.txt | AC | 31 ms | 640 KB |
sample1.txt | AC | 1 ms | 256 KB |
sample2.txt | AC | 1 ms | 256 KB |
sample3.txt | AC | 1 ms | 256 KB |