Submission #2854010
Source Code Expand
#include<bits/stdc++.h> using namespace std; int main() { int N, A, x, y; set<int> st; scanf("%d", &N); x = y = 0; for (int i = 0; i < N; i++) { scanf("%d", &A); bool flg = st.insert(A).second; if (flg == false) { y = max(y, min(x, A)); x = max(x, A); st.erase(A); } } printf("%lld\n", (long long)x * y); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Make a Rectangle |
User | atumari |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 436 Byte |
Status | AC |
Exec Time | 44 ms |
Memory | 4992 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:7:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &N); ^ ./Main.cpp:10:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &A); ^
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 | 43 ms | 2944 KB |
2.txt | AC | 10 ms | 256 KB |
3.txt | AC | 44 ms | 4992 KB |
4.txt | AC | 39 ms | 1152 KB |
5.txt | AC | 10 ms | 256 KB |
6.txt | AC | 19 ms | 256 KB |
7.txt | AC | 19 ms | 256 KB |
8.txt | AC | 8 ms | 256 KB |
9.txt | AC | 20 ms | 2560 KB |
sample1.txt | AC | 1 ms | 256 KB |
sample2.txt | AC | 1 ms | 256 KB |
sample3.txt | AC | 1 ms | 256 KB |