Submission #2527903


Source Code Expand

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
using ll = int long long;
map <int ,int> mpa,mpb;

int main (){
  ll N;
  cin  >> N;
  ll a[N];
  ll ans=0;
  ll l=0,r=0;
  for(ll i=0;i<N;i++){
    cin >> a[i];
  }
  sort(a,a+N);
  ll k=1;
  ll tmp;
  for(ll i=1;i<N;i++){
    if(a[i-1]==a[i]){
      k++;
      l=a[i];
      if(k>=4){
        l=r=a[i];
      }
      continue;
    }
    else{
      tmp=l;
      l=r;
      r=tmp;
      k=1;
    }
  }
  ans=l*r;
  cout << ans;
}

Submission Info

Submission Time
Task C - Make a Rectangle
User arks1225
Language C++14 (GCC 5.4.1)
Score 0
Code Size 681 Byte
Status WA
Exec Time 47 ms
Memory 1024 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 3
AC × 14
WA × 1
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 47 ms 1024 KB
2.txt AC 22 ms 640 KB
3.txt AC 46 ms 1024 KB
4.txt AC 47 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