Submission #1798922
Source Code Expand
#include <iostream> #include <set> using namespace std; int main() { size_t n; set<int> s; cin >> n; for (auto i = 0u; i < n; ++i) { int a; cin >> a; s.insert(a); } auto j = end(s); --j; --j; cout << *j << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - 心配性な富豪、ファミリーレストランに行く。 |
User | atctk |
Language | C++ (GCC 5.4.1) |
Score | 0 |
Code Size | 319 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:12:15: error: ‘i’ does not name a type for (auto i = 0u; i < n; ++i) { ^ ./Main.cpp:12:23: error: expected ‘;’ before ‘i’ for (auto i = 0u; i < n; ++i) { ^ ./Main.cpp:12:23: error: ‘i’ was not declared in this scope ./Main.cpp:18:10: error: ‘j’ does not name a type auto j = end(s); ^ ./Main.cpp:19:7: error: ‘j’ was not declared in this scope --j; ^