# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
203232 | Noam527 | Rope (JOI17_rope) | C++17 | 1174 ms | 76920 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>
#define finish(x) return cout << x << endl, 0
typedef long long ll;
typedef long double ldb;
const int md = 1e9 + 7;
const ll inf = 4e18;
const int OO = 0;
const int OOO = 1;
using namespace std;
const int N = 1e6 + 10;
int n, m, a[N];
vector<int> pos[N];
int mx;
int freq[N] = {};
int freq_count[N] = {};
void add(int val) {
if (OO) cout << "adding " << val << '\n';
--freq_count[freq[val]];
++freq[val];
++freq_count[freq[val]];
mx = max(mx, freq[val]);
}
void del(int val) {
if (OO) cout << "deleting " << val << '\n';
--freq_count[freq[val]];
if (mx == freq[val] && !freq_count[freq[val]])
# | 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... |