Submission #4032224
Source Code Expand
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main() { vector<int> store,ans; int N,stick,count=0; cout<<"Value of N: "; cin>>N; cout<<"Enter stick length : "; for(int i=0;i<N;i++) { cin>>stick; store.push_back(stick); } sort(store.begin(),store.end()); reverse(store.begin(),store.end()); for(int i=0;count<2&&i<N-1;i++) { if(store[i]==store[i+1]) { count++; ans.push_back(store[i]); i++; } } if(count==2) { cout<<ans[0]*ans[1]; } else cout<<'0'; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Make a Rectangle |
User | vjudge3 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 658 Byte |
Status | WA |
Exec Time | 50 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 | 50 ms | 892 KB |
2.txt | WA | 23 ms | 640 KB |
3.txt | WA | 47 ms | 892 KB |
4.txt | WA | 47 ms | 892 KB |
5.txt | WA | 22 ms | 640 KB |
6.txt | WA | 44 ms | 892 KB |
7.txt | WA | 44 ms | 892 KB |
8.txt | WA | 18 ms | 640 KB |
9.txt | WA | 24 ms | 640 KB |
sample1.txt | WA | 1 ms | 256 KB |
sample2.txt | WA | 1 ms | 256 KB |
sample3.txt | WA | 1 ms | 256 KB |