# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
333558 | juggernaut | Money (IZhO17_money) | C++14 | 0 ms | 364 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 n,a[1000005],pos,ans,mx;
set<int>st;
int main(){
st.insert(2e9);
scanf("%d",&n);
for(int i=0;i<n;i++)scanf("%d",&a[i]);
while(pos<n){
ans++;
mx=*st.upper_bound(a[pos]);
st.insert(a[pos]);
while(pos+1<n&&a[pos]<=a[pos+1]&&a[pos]<=mx)pos++,st.insert(a[pos]);
//cout<<pos<<" ";
pos++;
}
printf("%d",ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |