# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
934364 |
2024-02-27T08:18:02 Z |
allin27x |
Money (IZhO17_money) |
C++17 |
|
1 ms |
500 KB |
#include <bits/stdc++.h>
using namespace std;
signed main(){
int n; cin>>n;
vector<int> a(n,0);
for (int i=0; i<n; i++) cin>>a[i];
int res = 1;
set<int> t;
for (int i=0; i<n-1; i++){
int x = a[i]; int y = a[i+1];
if (x>y) {res++; continue;}
auto r = t.upper_bound(x);
if (r == t.end()) continue;
if (*r < y) res++;
}
cout<<res;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
500 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
500 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
500 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
500 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |