# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
340260 |
2020-12-27T11:00:28 Z |
Tosic |
Money (IZhO17_money) |
C++14 |
|
1 ms |
364 KB |
#include <bits/stdc++.h>
#define maxn 1000010
using namespace std;
int n, a[maxn], ans;
set<int> aN;
int main(){
ios_base::sync_with_stdio(0);
cout.tie(0);
cin.tie(0);
cin >> n;
vector<int> res;
for(int i = 0; i < n; ++i){
cin >> a[i];
if(res.empty() or (a[i] > res.back() and aN.lower_bound(res.back())==aN.lower_bound(a[i]))){
res.push_back(a[i]);
} else {
res.clear();
++ans;
for(auto j:res){
aN.insert(j);
}
}
}
if(!res.empty()){
++ans;
}
cout << ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |