# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
64066 | Just_Solve_The_Problem | Zalmoxis (BOI18_zalmoxis) | C++17 | 337 ms | 8440 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 ll long long
const int N = (int)1e6 + 7;
const int inf = (int)1e9 + 7;
int n, k;
ll a[N];
map < ll, int > cnt;
int table[21][N];
int numlog[N];
void build() {
for (int i = 2; i < N; i++) {
numlog[i] = numlog[i / 2] + 1;
}
for (int i = 0; i <= 20; i++) {
for (int j = 1; j <= n; j++) {
if (!i) {
table[i][j] = a[j];
} else {
table[i][j] = min(table[i - 1][j], table[i - 1][min(j + (1 << (i - 1)), n)]);
}
}
}
}
int getmin(int l, int r) {
int lg = numlog[r - l + 1];
return min(table[lg][l], table[lg][r - (1 << lg) + 1]);
}
main() {
scanf("%d %d", &n, &k);
ll mn = (ll)1e18;
for (int i = 1; i <= n; i++) {
cin >> a[i];
assert(a[i] <= (int)1e6);
mn = min(mn, a[i]);
cnt[a[i]]++;
}
return 0;
int in;
ll cur = -1;
while (1) {
if (cnt[mn] & 1) {
cur = mn;
break;
}
cnt[mn + 1] += cnt[mn] / 2;
cnt[mn] = 0;
mn++;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |