제출 #475169

#제출 시각아이디문제언어결과실행 시간메모리
475169Ahmed57Po (COCI21_po)C++14
10 / 70
1090 ms1740 KiB
#include <bits/stdc++.h> using namespace std; int main() { long long n,ans = 0; cin>>n; vector<long long>arr(n),att(n); for(int i=0;i<n;i++){ cin>>arr[i]; att[i] = arr[i]; } sort(att.begin(),att.end()); for(int k = 0;k<n;k++){ if(k>0&&att[k]==att[k-1])continue; long long m = att[k]; bool ss = false; for(int i=0;i<n;i++){ if(arr[i]>=m&&!ss){ ss = true; ans++; }else if(arr[i]<m)ss = false; } } cout<<ans<<"\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...