Submission #523277

#TimeUsernameProblemLanguageResultExecution timeMemory
523277tatoPo (COCI21_po)C++14
20 / 70
77 ms5540 KiB
#include <bits/stdc++.h> #define ll long long using namespace std; map <int,int> mp; void answer() { int n; cin >> n; int a[n + 1]; for(int i = 1; i <= n; i++) cin >> a[i]; int cnt = 1; mp[a[1]] = 1; for(int i = 2; i <= n; i++) if(a[i] > a[i-1] or mp[a[i]] == 0) { cnt++; mp[a[i]] = 1; } else mp[a[i]] = 1; cout << cnt; } int main() { int t = 1; //cin >> t; while(t--) answer(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...