| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1307297 | Double_Slash | Worst Reporter 3 (JOI18_worst_reporter3) | C++20 | 1104 ms | 5368 KiB |
#include <bits/stdc++.h>
using namespace std;
int n, q, T[500001]{1};
int main() {
cin >> n >> q;
for (int i = 1; i <= n; ++i) {
int d;
cin >> d;
T[i] = T[i - 1] * (d / T[i - 1] + !!(d % T[i - 1]));
}
while (q--) {
int t, l, r;
cin >> t >> l >> r;
auto ss = [&] (int x) {
int i = -1;
for (int k = 19; k--;) {
if ((i += 1 << k) > n) goto no;
if (T[i] * (t / T[i]) - i < x) no: i -= 1 << k;
}
return i;
};
cout << ss(l) - ss(r + 1) << endl;
}
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
