# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
378491 | 2021-03-17T00:49:08 Z | YJU | Brunhilda’s Birthday (BOI13_brunhilda) | C++14 | 697 ms | 262148 KB |
#include<bits/stdc++.h> #pragma GCC optimize("unroll-loops,no-stack-protector,Ofast") using namespace std; typedef long long ll; typedef pair<ll,ll> pll; const ll N=2e7+5; const ll INF=1e9+1; #define REP(i,n) for(int i=0;i<n;i++) #define REP1(i,n) for(int i=1;i<=n;i++) #define X first #define Y second #define pb push_back #define mp make_pair #define lwb lower_bound ll m,q,x,jump[N],dp[N]; int main(){ ios_base::sync_with_stdio(0);cin.tie(0); cin>>m>>q; REP(i,m){ cin>>x; for(int j=x-1;j<N;j+=x){ jump[j]=x-1; } } for(int i=N-1;i>=1;i--){ jump[i]=max(jump[i],jump[i+1]-1); } for(int i=1;i<N;i++){ dp[i]=(i>=jump[i]&&jump[i]!=0?min(INF,dp[i-jump[i]]+1):INF); } while(q--){ cin>>x; if(dp[x]==INF){ cout<<"OO\n"; }else{ cout<<dp[x]<<"\n"; } } return 0; }
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 210 ms | 262148 KB | Execution killed with signal 9 |
2 | Runtime error | 246 ms | 262148 KB | Execution killed with signal 9 |
3 | Runtime error | 235 ms | 262148 KB | Execution killed with signal 9 |
4 | Runtime error | 201 ms | 262148 KB | Execution killed with signal 9 |
5 | Runtime error | 228 ms | 262148 KB | Execution killed with signal 9 |
6 | Runtime error | 207 ms | 262144 KB | Execution killed with signal 9 |
7 | Runtime error | 236 ms | 262148 KB | Execution killed with signal 9 |
8 | Runtime error | 255 ms | 262148 KB | Execution killed with signal 9 |
9 | Runtime error | 294 ms | 262148 KB | Execution killed with signal 9 |
10 | Runtime error | 338 ms | 262148 KB | Execution killed with signal 9 |
11 | Runtime error | 309 ms | 262148 KB | Execution killed with signal 9 |
12 | Runtime error | 199 ms | 262144 KB | Execution killed with signal 9 |
13 | Runtime error | 509 ms | 262144 KB | Execution killed with signal 9 |
14 | Runtime error | 527 ms | 262148 KB | Execution killed with signal 9 |
15 | Runtime error | 267 ms | 262148 KB | Execution killed with signal 9 |
16 | Runtime error | 256 ms | 262148 KB | Execution killed with signal 9 |
17 | Runtime error | 246 ms | 262148 KB | Execution killed with signal 9 |
18 | Runtime error | 206 ms | 262148 KB | Execution killed with signal 9 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 238 ms | 262148 KB | Execution killed with signal 9 |
2 | Runtime error | 259 ms | 262148 KB | Execution killed with signal 9 |
3 | Runtime error | 622 ms | 262148 KB | Execution killed with signal 9 |
4 | Runtime error | 278 ms | 262148 KB | Execution killed with signal 9 |
5 | Runtime error | 432 ms | 262148 KB | Execution killed with signal 9 |
6 | Runtime error | 246 ms | 262148 KB | Execution killed with signal 9 |
7 | Runtime error | 237 ms | 262148 KB | Execution killed with signal 9 |
8 | Runtime error | 273 ms | 262148 KB | Execution killed with signal 9 |
9 | Runtime error | 508 ms | 262148 KB | Execution killed with signal 9 |
10 | Runtime error | 635 ms | 262148 KB | Execution killed with signal 9 |
11 | Runtime error | 608 ms | 262148 KB | Execution killed with signal 9 |
12 | Runtime error | 357 ms | 262148 KB | Execution killed with signal 9 |
13 | Runtime error | 218 ms | 262148 KB | Execution killed with signal 9 |
14 | Runtime error | 273 ms | 262148 KB | Execution killed with signal 9 |
15 | Runtime error | 508 ms | 262144 KB | Execution killed with signal 9 |
16 | Runtime error | 256 ms | 262148 KB | Execution killed with signal 9 |
17 | Runtime error | 519 ms | 262144 KB | Execution killed with signal 9 |
18 | Runtime error | 516 ms | 262148 KB | Execution killed with signal 9 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 524 ms | 262148 KB | Execution killed with signal 9 |
2 | Runtime error | 631 ms | 262148 KB | Execution killed with signal 9 |
3 | Runtime error | 642 ms | 262148 KB | Execution killed with signal 9 |
4 | Runtime error | 372 ms | 262148 KB | Execution killed with signal 9 |
5 | Runtime error | 277 ms | 262144 KB | Execution killed with signal 9 |
6 | Runtime error | 495 ms | 262148 KB | Execution killed with signal 9 |
7 | Runtime error | 449 ms | 262148 KB | Execution killed with signal 9 |
8 | Runtime error | 520 ms | 262148 KB | Execution killed with signal 9 |
9 | Runtime error | 520 ms | 262148 KB | Execution killed with signal 9 |
10 | Runtime error | 416 ms | 262148 KB | Execution killed with signal 9 |
11 | Runtime error | 345 ms | 262144 KB | Execution killed with signal 9 |
12 | Runtime error | 484 ms | 262148 KB | Execution killed with signal 9 |
13 | Runtime error | 593 ms | 262148 KB | Execution killed with signal 9 |
14 | Runtime error | 349 ms | 262144 KB | Execution killed with signal 9 |
15 | Runtime error | 507 ms | 262148 KB | Execution killed with signal 9 |
16 | Runtime error | 568 ms | 262148 KB | Execution killed with signal 9 |
17 | Runtime error | 489 ms | 262148 KB | Execution killed with signal 9 |
18 | Runtime error | 632 ms | 262148 KB | Execution killed with signal 9 |
19 | Runtime error | 223 ms | 262144 KB | Execution killed with signal 9 |
20 | Runtime error | 638 ms | 262148 KB | Execution killed with signal 9 |
21 | Runtime error | 406 ms | 262148 KB | Execution killed with signal 9 |
22 | Runtime error | 614 ms | 262144 KB | Execution killed with signal 9 |
23 | Runtime error | 274 ms | 262148 KB | Execution killed with signal 9 |
24 | Runtime error | 242 ms | 262148 KB | Execution killed with signal 9 |
25 | Runtime error | 398 ms | 262148 KB | Execution killed with signal 9 |
26 | Runtime error | 373 ms | 262144 KB | Execution killed with signal 9 |
27 | Runtime error | 697 ms | 262148 KB | Execution killed with signal 9 |
28 | Runtime error | 235 ms | 262148 KB | Execution killed with signal 9 |
29 | Runtime error | 586 ms | 262144 KB | Execution killed with signal 9 |
30 | Runtime error | 523 ms | 262148 KB | Execution killed with signal 9 |
31 | Runtime error | 268 ms | 262148 KB | Execution killed with signal 9 |
32 | Runtime error | 291 ms | 262148 KB | Execution killed with signal 9 |
33 | Runtime error | 200 ms | 262144 KB | Execution killed with signal 9 |
34 | Runtime error | 442 ms | 262148 KB | Execution killed with signal 9 |
35 | Runtime error | 248 ms | 262148 KB | Execution killed with signal 9 |
36 | Runtime error | 604 ms | 262148 KB | Execution killed with signal 9 |
37 | Runtime error | 277 ms | 262148 KB | Execution killed with signal 9 |
38 | Runtime error | 505 ms | 262148 KB | Execution killed with signal 9 |
39 | Runtime error | 245 ms | 262148 KB | Execution killed with signal 9 |
40 | Runtime error | 430 ms | 262148 KB | Execution killed with signal 9 |
41 | Runtime error | 389 ms | 262144 KB | Execution killed with signal 9 |
42 | Runtime error | 554 ms | 262148 KB | Execution killed with signal 9 |