제출 #1312831

#제출 시각아이디문제언어결과실행 시간메모리
1312831aaaaaaaaPo (COCI21_po)C++20
20 / 70
11 ms956 KiB
#include <bits/stdc++.h> using namespace std; #define int long long signed main(){ ios::sync_with_stdio(0); cin.tie(nullptr); cout.tie(nullptr); int n, ans = 0; cin >> n; vector<int> st; for(int i = 1, x; i <= n; ++i){ cin >> x; if(st.size() && st.back() > x) st.pop_back(); if(st.empty() || st.back() < x) ans += 1, st.push_back(x); } cout << ans << "\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...