# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
961100 | Pety | Izbori (COCI22_izbori) | C++14 | 593 ms | 8016 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 ll long long
using namespace std;
const int INF = 1e9;
const int MOD = 1e9 + 7;
int n, a[250002];
ll sol;
int idk[500005];
void divide (int st, int dr) {
if (st == dr) {
sol += 1;
return;
}
int mid = (st + dr) / 2;
divide(st, mid);
divide(mid + 1, dr);
map<int, int>fr;
set<int>Maj;
for (int i = mid; i >= st; i--) {
fr[a[i]]++;
if (fr[a[i]] >= (mid - i + 1) / 2 + 1)
Maj.insert(a[i]);
}
fr.clear();
for (int i = mid + 1; i <= dr; i++) {
# | 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... |