Submission #990062

#TimeUsernameProblemLanguageResultExecution timeMemory
990062tch1cherinMoney (IZhO17_money)C++17
100 / 100
910 ms54352 KiB
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; set<int> S = {numeric_limits<int>::max()}; int answer = 0, limit = -1, last = *S.begin(); for (int i = 0; i < N; i++) { int x; cin >> x; if (x > limit || x < last) { limit = *S.upper_bound(x); answer++; } S.insert(last = x); } cout << answer << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...