# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
949474 | hngwlog | Real Mountains (CCO23_day1problem2) | C++14 | 1 ms | 348 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;
#define fi first
#define se second
#define _size(x) (int)x.size()
const long long mod = 1e6 + 3;
int n;
long long ans = 0;
vector<long long> h, newH;
void solve() {
set<pair<long long, long long>> st;
for (int i = 0; i < n; i++) {
if (h[i] == newH[i]) {
auto it = st.upper_bound({h[i], newH[i]});
if (it == st.begin()) st.insert({h[i], newH[i]});
else {
it--;
if (it->se < h[i]) st.insert({h[i], newH[i]});
}
continue;
}
vector<pair<long long, long long>> g;
auto it = st.upper_bound({h[i], h[i]});
if (it != st.begin()) {
it--;
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |