Submission #156162

#TimeUsernameProblemLanguageResultExecution timeMemory
156162theboatmanMoney (IZhO17_money)C++17
0 / 100
2 ms376 KiB
#include <bits/stdc++.h> #define y1 theboatman #define make_struct(args...) {args} using namespace std; int main() { cin.tie(0); ios :: sync_with_stdio(0); int n; cin >> n; vector <int> a(n); for(int i = 0; i < n; i++) { cin >> a[i]; } int ans = 0; for(int i = 0; i < n; i++) { int x = a[i]; while(i < n && x <= a[i]) { x = a[i]; i++; } i--; ans++; } cout << ans << "\n"; return 0; } /* 1 5 6 */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...