# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
635253 | ParsaEs | Worst Reporter 3 (JOI18_worst_reporter3) | C++14 | 507 ms | 20700 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.
//InTheNameOfGOD
//PRS;)
#pragma GCC optimize("unroll-loops", "O2", "Ofast", "O3")
#pragma GCC target("avx2", "sse", "sse2")
#include<bits/stdc++.h>
#define Fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define rep(i, l, r) for(ii i = l; i < r; i++)
#define max(x, y) (x > y ? x : y)
typedef int ii;
using namespace std;
constexpr ii xn = 5e5 + 5;
ii d[xn];
ii main()
{
Fast;
ii n, q;
cin >> n >> q;
rep(i, 0, n) cin >> d[i];
rep(i, 1, n) d[i] = ((d[i] + d[i - 1] - 1) / d[i - 1]) * d[i - 1];
while(q--)
{
ii t, l, r, p1 = 0, p2 = n, p3 = 0, p4 = n;
cin >> t >> l >> r;
while(p1 < p2)
{
ii m = p1 + p2 >> 1;
if((t / d[m]) * d[m] - m - 1 < l) p2 = m;
else p1 = m + 1;
}
while(p3 < p4)
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |