# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
749113 | stevancv | Worst Reporter 3 (JOI18_worst_reporter3) | C++14 | 309 ms | 25356 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
#define ld long double
#define sp ' '
#define en '\n'
#define smin(a, b) a = min(a, b)
#define smax(a, b) a = max(a, b)
using namespace std;
const int N = 5e5 + 2;
const int inf = 1e9;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n, Q;
cin >> n >> Q;
vector<int> d(n), koef(n);
for (int i = 0; i < n; i++) cin >> d[i];
koef[0] = d[0];
for (int i = 1; i < n; i++) {
ll o = (d[i] - 1) / koef[i - 1];
ll u = (ll) (koef[i - 1]) * (o + 1);
if (u > 1e9) {
for (int zz = 0; zz < n - i; zz++) {
d.pop_back();
koef.pop_back();
}
break;
}
koef[i] = koef[i - 1] * (o + 1);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |