# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
545267 | Ai7081 | Money (IZhO17_money) | C++17 | 1 ms | 212 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
const int inf = 1e9;
int n, a, out, now=inf, nxt;
multiset<int> s;
int main() {
scanf(" %d", &n);
while (n--) {
scanf(" %d", &a);
if (a < now || a > nxt) out++;
auto it = s.insert(a);
it++;
nxt = (it == s.end()) ? inf : *it;
now = a;
}
printf("%d", out);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |