# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
631296 | 2022-08-18T02:54:52 Z | bachhoangxuan | Brunhilda’s Birthday (BOI13_brunhilda) | C++17 | 237 ms | 262148 KB |
#include<bits/stdc++.h> using namespace std; #define maxa 10000000 #define maxn 100005 #define pii pair<int,int> int q,m,dp[maxa+5],p[maxn]; vector<int> s[maxa+5]; signed main(){ ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); cin >> m >> q; for(int i=1;i<=m;i++){ cin >> p[i];s[0].push_back(p[i]); } int pre=0,lst=0,num=0,dead=-1; while(true){ if(pre>lst){ dead=pre; break; } int nxt=lst; for(int i=pre;i<=lst;i++){ dp[i]=num; for(auto it:s[i]){ nxt=max(nxt,i+it-1); if(i+it<=maxa) s[i+it].push_back(it); } } pre=lst+1;lst=nxt;num++; if(lst>maxa) break; } for(int i=pre;i<=min(lst,maxa);i++) dp[i]=num; cout << dead << '\n'; for(int i=1;i<=q;i++){ int a;cin >> a; if(a>=dead && dead!=-1) cout << "oo\n"; else cout << dp[a] << '\n'; } }
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 109 ms | 235116 KB | Output isn't correct |
2 | Runtime error | 150 ms | 262144 KB | Execution killed with signal 9 |
3 | Incorrect | 121 ms | 241292 KB | Output isn't correct |
4 | Runtime error | 144 ms | 262144 KB | Execution killed with signal 9 |
5 | Runtime error | 146 ms | 262144 KB | Execution killed with signal 9 |
6 | Incorrect | 114 ms | 235080 KB | Output isn't correct |
7 | Incorrect | 118 ms | 241332 KB | Output isn't correct |
8 | Incorrect | 190 ms | 260012 KB | Output isn't correct |
9 | Runtime error | 158 ms | 262144 KB | Execution killed with signal 9 |
10 | Runtime error | 160 ms | 262144 KB | Execution killed with signal 9 |
11 | Runtime error | 177 ms | 262144 KB | Execution killed with signal 9 |
12 | Runtime error | 138 ms | 262144 KB | Execution killed with signal 9 |
13 | Runtime error | 183 ms | 262144 KB | Execution killed with signal 9 |
14 | Runtime error | 178 ms | 262144 KB | Execution killed with signal 9 |
15 | Runtime error | 152 ms | 262144 KB | Execution killed with signal 9 |
16 | Runtime error | 159 ms | 262144 KB | Execution killed with signal 9 |
17 | Runtime error | 187 ms | 262148 KB | Execution killed with signal 9 |
18 | Runtime error | 147 ms | 262144 KB | Execution killed with signal 9 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 184 ms | 262144 KB | Execution killed with signal 9 |
2 | Runtime error | 178 ms | 262144 KB | Execution killed with signal 9 |
3 | Runtime error | 205 ms | 262144 KB | Execution killed with signal 9 |
4 | Runtime error | 158 ms | 262144 KB | Execution killed with signal 9 |
5 | Runtime error | 195 ms | 262144 KB | Execution killed with signal 9 |
6 | Runtime error | 141 ms | 262144 KB | Execution killed with signal 9 |
7 | Runtime error | 158 ms | 262144 KB | Execution killed with signal 9 |
8 | Runtime error | 172 ms | 262144 KB | Execution killed with signal 9 |
9 | Runtime error | 218 ms | 262144 KB | Execution killed with signal 9 |
10 | Runtime error | 205 ms | 262144 KB | Execution killed with signal 9 |
11 | Runtime error | 221 ms | 262144 KB | Execution killed with signal 9 |
12 | Runtime error | 176 ms | 262144 KB | Execution killed with signal 9 |
13 | Runtime error | 138 ms | 262144 KB | Execution killed with signal 9 |
14 | Runtime error | 162 ms | 262144 KB | Execution killed with signal 9 |
15 | Runtime error | 199 ms | 262144 KB | Execution killed with signal 9 |
16 | Runtime error | 211 ms | 262144 KB | Execution killed with signal 9 |
17 | Runtime error | 184 ms | 262144 KB | Execution killed with signal 9 |
18 | Runtime error | 190 ms | 262144 KB | Execution killed with signal 9 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 212 ms | 262144 KB | Execution killed with signal 9 |
2 | Runtime error | 205 ms | 262144 KB | Execution killed with signal 9 |
3 | Runtime error | 212 ms | 262144 KB | Execution killed with signal 9 |
4 | Runtime error | 165 ms | 262144 KB | Execution killed with signal 9 |
5 | Runtime error | 188 ms | 262144 KB | Execution killed with signal 9 |
6 | Runtime error | 200 ms | 262144 KB | Execution killed with signal 9 |
7 | Runtime error | 173 ms | 262144 KB | Execution killed with signal 9 |
8 | Runtime error | 215 ms | 262144 KB | Execution killed with signal 9 |
9 | Runtime error | 216 ms | 262144 KB | Execution killed with signal 9 |
10 | Runtime error | 165 ms | 262144 KB | Execution killed with signal 9 |
11 | Runtime error | 157 ms | 262144 KB | Execution killed with signal 9 |
12 | Runtime error | 177 ms | 262144 KB | Execution killed with signal 9 |
13 | Runtime error | 208 ms | 262144 KB | Execution killed with signal 9 |
14 | Runtime error | 169 ms | 262144 KB | Execution killed with signal 9 |
15 | Runtime error | 182 ms | 262144 KB | Execution killed with signal 9 |
16 | Runtime error | 188 ms | 262144 KB | Execution killed with signal 9 |
17 | Runtime error | 217 ms | 262144 KB | Execution killed with signal 9 |
18 | Runtime error | 205 ms | 262144 KB | Execution killed with signal 9 |
19 | Runtime error | 146 ms | 262144 KB | Execution killed with signal 9 |
20 | Runtime error | 237 ms | 262144 KB | Execution killed with signal 9 |
21 | Runtime error | 180 ms | 262144 KB | Execution killed with signal 9 |
22 | Runtime error | 205 ms | 262144 KB | Execution killed with signal 9 |
23 | Runtime error | 206 ms | 262144 KB | Execution killed with signal 9 |
24 | Runtime error | 151 ms | 262144 KB | Execution killed with signal 9 |
25 | Runtime error | 162 ms | 262144 KB | Execution killed with signal 9 |
26 | Runtime error | 168 ms | 262144 KB | Execution killed with signal 9 |
27 | Runtime error | 221 ms | 262144 KB | Execution killed with signal 9 |
28 | Runtime error | 151 ms | 262144 KB | Execution killed with signal 9 |
29 | Runtime error | 215 ms | 262144 KB | Execution killed with signal 9 |
30 | Runtime error | 187 ms | 262144 KB | Execution killed with signal 9 |
31 | Runtime error | 159 ms | 262144 KB | Execution killed with signal 9 |
32 | Runtime error | 157 ms | 262144 KB | Execution killed with signal 9 |
33 | Runtime error | 156 ms | 262144 KB | Execution killed with signal 9 |
34 | Runtime error | 187 ms | 262144 KB | Execution killed with signal 9 |
35 | Runtime error | 169 ms | 262144 KB | Execution killed with signal 9 |
36 | Runtime error | 216 ms | 262144 KB | Execution killed with signal 9 |
37 | Runtime error | 182 ms | 262144 KB | Execution killed with signal 9 |
38 | Runtime error | 205 ms | 262144 KB | Execution killed with signal 9 |
39 | Runtime error | 150 ms | 262144 KB | Execution killed with signal 9 |
40 | Runtime error | 174 ms | 262144 KB | Execution killed with signal 9 |
41 | Runtime error | 200 ms | 262144 KB | Execution killed with signal 9 |
42 | Runtime error | 183 ms | 262144 KB | Execution killed with signal 9 |