Submission #2872016
Source Code Expand
#include <bits/stdc++.h> using namespace std; const int N = 100010; int n,a[N],las; int main() { scanf("%d",&n); for (int i = 1 ; i <= n ; ++ i) scanf("%d",&a[i]); sort(a+1,a+n+1); for (int i = n ; i > 1 ; -- i) { if (a[i] == a[i-1]) { if (!las) { las = a[i]; -- i; } else return 0 * printf("%lld\n",1ll * las * a[i]); } } puts("0"); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Make a Rectangle |
User | cly_none |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 406 Byte |
Status | AC |
Exec Time | 19 ms |
Memory | 640 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:6:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&n); ^ ./Main.cpp:8:22: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&a[i]); ^
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 | 640 KB |
2.txt | AC | 8 ms | 384 KB |
3.txt | AC | 19 ms | 640 KB |
4.txt | AC | 19 ms | 640 KB |
5.txt | AC | 8 ms | 384 KB |
6.txt | AC | 15 ms | 640 KB |
7.txt | AC | 15 ms | 640 KB |
8.txt | AC | 7 ms | 384 KB |
9.txt | AC | 10 ms | 384 KB |
sample1.txt | AC | 1 ms | 256 KB |
sample2.txt | AC | 1 ms | 256 KB |
sample3.txt | AC | 1 ms | 256 KB |