# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
85413 | 2018-11-19T19:59:41 Z | ToadDaveski | Money (IZhO17_money) | C++14 | 3 ms | 660 KB |
#include <bits/stdc++.h> #define ll long long using namespace std; set <ll> st; ll a[1000001]; int main() { ll n,m,i,j,ans=0; cin>>n; for(i=1;i<=n;i++) cin>>a[i]; st.insert(10000000); for(i=1;i<=n;i++) { ans++; st.insert(a[i]); while(i<n && a[i+1]>=a[i] && a[i+1]<=(*st.upper_bound(a[i]))) { st.insert(a[i+1]); i++; } } cout<<ans; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 372 KB | Output is correct |
3 | Correct | 2 ms | 448 KB | Output is correct |
4 | Correct | 2 ms | 472 KB | Output is correct |
5 | Correct | 3 ms | 552 KB | Output is correct |
6 | Correct | 2 ms | 640 KB | Output is correct |
7 | Correct | 3 ms | 652 KB | Output is correct |
8 | Correct | 2 ms | 652 KB | Output is correct |
9 | Correct | 2 ms | 652 KB | Output is correct |
10 | Correct | 2 ms | 652 KB | Output is correct |
11 | Correct | 2 ms | 652 KB | Output is correct |
12 | Incorrect | 2 ms | 660 KB | Output isn't correct |
13 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 372 KB | Output is correct |
3 | Correct | 2 ms | 448 KB | Output is correct |
4 | Correct | 2 ms | 472 KB | Output is correct |
5 | Correct | 3 ms | 552 KB | Output is correct |
6 | Correct | 2 ms | 640 KB | Output is correct |
7 | Correct | 3 ms | 652 KB | Output is correct |
8 | Correct | 2 ms | 652 KB | Output is correct |
9 | Correct | 2 ms | 652 KB | Output is correct |
10 | Correct | 2 ms | 652 KB | Output is correct |
11 | Correct | 2 ms | 652 KB | Output is correct |
12 | Incorrect | 2 ms | 660 KB | Output isn't correct |
13 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 372 KB | Output is correct |
3 | Correct | 2 ms | 448 KB | Output is correct |
4 | Correct | 2 ms | 472 KB | Output is correct |
5 | Correct | 3 ms | 552 KB | Output is correct |
6 | Correct | 2 ms | 640 KB | Output is correct |
7 | Correct | 3 ms | 652 KB | Output is correct |
8 | Correct | 2 ms | 652 KB | Output is correct |
9 | Correct | 2 ms | 652 KB | Output is correct |
10 | Correct | 2 ms | 652 KB | Output is correct |
11 | Correct | 2 ms | 652 KB | Output is correct |
12 | Incorrect | 2 ms | 660 KB | Output isn't correct |
13 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 372 KB | Output is correct |
3 | Correct | 2 ms | 448 KB | Output is correct |
4 | Correct | 2 ms | 472 KB | Output is correct |
5 | Correct | 3 ms | 552 KB | Output is correct |
6 | Correct | 2 ms | 640 KB | Output is correct |
7 | Correct | 3 ms | 652 KB | Output is correct |
8 | Correct | 2 ms | 652 KB | Output is correct |
9 | Correct | 2 ms | 652 KB | Output is correct |
10 | Correct | 2 ms | 652 KB | Output is correct |
11 | Correct | 2 ms | 652 KB | Output is correct |
12 | Incorrect | 2 ms | 660 KB | Output isn't correct |
13 | Halted | 0 ms | 0 KB | - |