제출 #1312832

#제출 시각아이디문제언어결과실행 시간메모리
1312832aaaaaaaaPo (COCI21_po)C++20
30 / 70
10 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 = {0}; for(int i = 1, x; i <= n; ++i){ cin >> x; if(st.size() && st.back() > x) st.pop_back(); if(st.back() < x) ans += 1, st.push_back(x); } cout << ans << "\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...