# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
883284 |
2023-12-05T04:07:07 Z |
marcid |
Money (IZhO17_money) |
C++17 |
|
0 ms |
348 KB |
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6+9;
#define int long long
set<int> k; int ans;
signed main() {
int n; cin >> n;
int a[n]; for (int &i:a) cin >> i;
for (int i = 0; i < n;) {
ans++;
int it = *k.upper_bound(a[i]);
k.insert(a[i]); int j = i + 1;
for (; a[j-1]<=a[j] && a[j] <= it && j < n; j++) {
k.insert(a[j]);
} i = j;
} cout << ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |