Submission #4032411


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
int main()
{
    vector<int> store,ans;
    int N,stick,count=0;
    cin>>N;
    if(N<4||N>100000)return 0;
    for(int i=0;i<N;i++)
    {
        cin>>stick;
        store.push_back(stick);
        if(stick<1||stick>1000000000)return 0;
    }
    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<<(long long int)ans[0]*ans[1];
    else
        cout<<'0';
    return 0;
}

Submission Info

Submission Time
Task C - Make a Rectangle
User vjudge2
Language C++14 (GCC 5.4.1)
Score 300
Code Size 646 Byte
Status AC
Exec Time 51 ms
Memory 892 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 15
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 47 ms 892 KB
2.txt AC 23 ms 640 KB
3.txt AC 51 ms 892 KB
4.txt AC 47 ms 892 KB
5.txt AC 23 ms 640 KB
6.txt AC 44 ms 892 KB
7.txt AC 44 ms 892 KB
8.txt AC 19 ms 640 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