Submission #4051647


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;cin >> n;
	vector<int> a(n);
	rep(i,n) cin >> a.at(i);
	sort(a.rbegin(),a.rend());
	ll b=0,c=0;
	bool flg=false;
	rep(i,n-1){
		if(a.at(i)==a.at(i+1)){
			if(flg){
				c=a.at(i);
				break;
			}
			else{
				b=a.at(i);
				i++;
				flg=true;
			}
		}
	}
	cout << b*c << endl;
}

Submission Info

Submission Time
Task C - Make a Rectangle
User rhincodon66
Language C++14 (GCC 5.4.1)
Score 300
Code Size 548 Byte
Status AC
Exec Time 17 ms
Memory 640 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 17 ms 640 KB
2.txt AC 7 ms 512 KB
3.txt AC 17 ms 640 KB
4.txt AC 17 ms 640 KB
5.txt AC 7 ms 512 KB
6.txt AC 14 ms 640 KB
7.txt AC 13 ms 640 KB
8.txt AC 6 ms 384 KB
9.txt AC 9 ms 512 KB
sample1.txt AC 1 ms 256 KB
sample2.txt AC 1 ms 256 KB
sample3.txt AC 1 ms 256 KB