Submission #1366554
Source Code Expand
#include <iostream> #include <set> using namespace std; int main() { ios::sync_with_stdio(false); int N; cin >> N; set<int> cost; for ( int i = 0; i < N; i++ ) { int tmp; cin >> tmp; cost.insert(tmp); } cost.erase(max_element(cost.begin(), cost.end())); cout << *max_element(cost.begin(), cost.end()) << "\n"; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - 心配性な富豪、ファミリーレストランに行く。 |
User | suzuhira |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 369 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:15:50: error: ‘max_element’ was not declared in this scope cost.erase(max_element(cost.begin(), cost.end())); ^