# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
758283 |
2023-06-14T11:50:11 Z |
haxorman |
Money (IZhO17_money) |
C++14 |
|
1 ms |
212 KB |
#include <bits/stdc++.h>
using namespace std;
const int mxN = 1e6 + 7;
int arr[mxN];
int32_t main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n;
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> arr[i];
}
arr[n] = INT_MIN;
int ans = 0, prv = 0;
multiset<int> vals;
for (int i = 1; i <= n; ++i) {
vals.insert(arr[prv]);
auto it = vals.upper_bound(arr[prv]);
if (arr[prv] > arr[i] || (it != vals.end() && *it < arr[i])) {
++ans;
prv = i;
continue;
}
}
cout << ans << "\n";
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |