# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
333558 | 2020-12-07T04:27:30 Z | juggernaut | Money (IZhO17_money) | C++14 | 0 ms | 364 KB |
#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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 364 KB | Output is correct |
2 | Incorrect | 0 ms | 364 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 364 KB | Output is correct |
2 | Incorrect | 0 ms | 364 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 364 KB | Output is correct |
2 | Incorrect | 0 ms | 364 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 364 KB | Output is correct |
2 | Incorrect | 0 ms | 364 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |