Submission #4032167
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
#define sci1(a) scanf("%d",&a)
#define sci2(a,b) scanf("%d %d",&a,&b)
#define sci3(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define scs1(s) scanf("%s",s)
int main(){
int n,tmp,i,j;
int64_t rec[2]={0,0};
vector<int> data;
sci1(n);
for(i=0;i<n;i++){
sci1(tmp);
data.push_back(tmp);
}
sort(data.begin(),data.end());
j=0;
for(i=n-1;i>0;i--){
if(data[i]==data[i-1]){
rec[j]=(int64_t)data[i];
i--;
j++;
}
if(j==2)break;
}
if(j!=2){
printf("0");
return 0;
}
cout<<rec[0]*rec[1];
return 0;
}
Submission Info
Submission Time
2019-01-17 22:36:13+0900
Task
C - Make a Rectangle
User
vjudge2
Language
C++14 (GCC 5.4.1)
Score
300
Code Size
671 Byte
Status
AC
Exec Time
19 ms
Memory
892 KB
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:11:12: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
sci1(n);
^
./Main.cpp:13:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
sci1(tmp);
^
Judge Result
Set Name
Sample
All
Score / Max Score
0 / 0
300 / 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
AC
19 ms
892 KB
2.txt
AC
8 ms
640 KB
3.txt
AC
19 ms
892 KB
4.txt
AC
19 ms
892 KB
5.txt
AC
8 ms
640 KB
6.txt
AC
16 ms
892 KB
7.txt
AC
15 ms
892 KB
8.txt
AC
7 ms
640 KB
9.txt
AC
10 ms
640 KB
sample1.txt
AC
1 ms
256 KB
sample2.txt
AC
1 ms
256 KB
sample3.txt
AC
1 ms
256 KB