제출 #1152383

#제출 시각아이디문제언어결과실행 시간메모리
1152383hamzabcMoney (IZhO17_money)C++20
0 / 100
0 ms328 KiB
#include <bits/stdc++.h> using namespace std; #define all(x) x.begin(), x.end() #define mod 1000000007 #define sp << " " << #define endl << '\n' signed main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); long long int N; cin >> N; vector<long long int> lst(N); for (int i = 0; i < N; i++){ cin >> lst[i]; } long long int ret = 1; set<long long int> st; st.insert(lst[0]); for (int i = 1; i < N; i++){ if (lst[i] < lst[i - 1] || (st.upper_bound(lst[i - 1]) != st.upper_bound(lst[i]))){ ret++; } st.insert(lst[i]); } cout << ret; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...