# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
77111 |
2018-09-22T09:02:21 Z |
zetapi |
Money (IZhO17_money) |
C++14 |
|
2 ms |
676 KB |
#include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define int long long
#define itr iterator
typedef pair<ll,ll> pii;
const ll MAX=2e6;
const ll INF=1e12;
set<int> st;
set<int> ::itr it;
int N,res,arr[MAX];
signed main()
{
ios_base::sync_with_stdio(false);
cin>>N;
for(int A=1;A<=N;A++)
cin>>arr[A];
st.insert(0);
st.insert(MAX);
for(int A=1;A<=N;)
{
it=st.upper_bound(arr[A]);
res++;
while(A<=N)
{
st.insert(arr[A]);
if(arr[A+1]>=arr[A] and arr[A+1]<*it)
A++;
else
break;
}
A++;
}
cout<<res;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
616 KB |
Output is correct |
4 |
Incorrect |
2 ms |
676 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
616 KB |
Output is correct |
4 |
Incorrect |
2 ms |
676 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
616 KB |
Output is correct |
4 |
Incorrect |
2 ms |
676 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
616 KB |
Output is correct |
4 |
Incorrect |
2 ms |
676 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |