# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
475169 | Ahmed57 | Po (COCI21_po) | C++14 | 1090 ms | 1740 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |