# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
44708 | 2018-04-05T10:44:32 Z | top34051 | Worst Reporter 3 (JOI18_worst_reporter3) | C++17 | 16 ms | 656 KB |
#include<bits/stdc++.h> using namespace std; #define ll long long const int maxn = 1e3 + 5; int n,q; ll dist[maxn]; int get(ll T, ll L) { int l = 1, r = n, mid, pos = 0; while(l<=r) { mid = (l+r)/2; if(-mid + (T/dist[mid])*dist[mid] >= L) { pos = mid; l = mid+1; } else r = mid-1; } return pos; } int main() { scanf("%d%d",&n,&q); dist[0] = 1; for(int i=1;i<=n;i++) { scanf("%lld",&dist[i]); dist[i] = (ll)ceil((double)dist[i]/dist[i-1]) * dist[i-1]; } while(q--) { ll T, L, R; int res = 0; scanf("%lld%lld%lld",&T,&L,&R); for(int i=0;i<=n;i++) { ll temp = -i+(T/dist[i])*dist[i]; if(L<=temp && temp<=R) res++; } printf("%d\n",res); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 248 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 15 ms | 356 KB | Output is correct |
2 | Correct | 15 ms | 432 KB | Output is correct |
3 | Correct | 16 ms | 432 KB | Output is correct |
4 | Correct | 15 ms | 636 KB | Output is correct |
5 | Correct | 15 ms | 656 KB | Output is correct |
6 | Correct | 16 ms | 656 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 248 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |