# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1109610 | 2024-11-07T07:05:06 Z | 0pt1mus23 | Brunhilda’s Birthday (BOI13_brunhilda) | C++14 | 330 ms | 262144 KB |
#include <bits/stdc++.h> using namespace std; #define int long long int #define ins insert #define pb push_back #define endl '\n' #define putr(x) cout<<x<<endl;return; #define all(x) x.begin(),x.end() int nxt(){ int x;cin>>x; return x; } const int mod = 1e9 +7, sze = 1e7 +10, inf = INT_MAX, LG = 20; int dp[sze]; vector<pair<int,int>> event[sze]; void fast(){ int n,q; cin>>n>>q; multiset<int> ans; int mx = 0; for(int i=1;i<=n;i++){ int p;cin>>p; event[p].pb({p,p}); mx=max(mx,p); } for(int i =1;i<sze;i++){ dp[i]=inf; for(auto v:event[i]){ if(ans.find(dp[v.first]) !=ans.end() ){ ans.erase(ans.find(dp[v.first])); } } if( i < mx ){ dp[i]=1; } else if(!ans.empty()){ dp[i]= (*ans.begin())+1; } if(dp[i]<inf){ for(auto v:event[i]){ ans.ins(dp[i]); if(i + v.second < sze){ event[i + v.second].pb({i,v.second}); } } } } while(q--){ int v; cin>>v; if(dp[v]>=inf){ cout<<"oo"<<endl; } else{ cout<<dp[v]<<endl; } } } signed main(){ // ios::sync_with_stdio(0); // cin.tie(0); // cout.tie(0); int tt = 1; // cin>>tt; while(tt--){ fast(); } return 0; }
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 126 ms | 262144 KB | Execution killed with signal 9 |
2 | Runtime error | 207 ms | 262144 KB | Execution killed with signal 9 |
3 | Runtime error | 150 ms | 262144 KB | Execution killed with signal 9 |
4 | Runtime error | 207 ms | 262144 KB | Execution killed with signal 9 |
5 | Runtime error | 166 ms | 262144 KB | Execution killed with signal 9 |
6 | Runtime error | 151 ms | 262144 KB | Execution killed with signal 9 |
7 | Runtime error | 129 ms | 262144 KB | Execution killed with signal 9 |
8 | Runtime error | 164 ms | 262144 KB | Execution killed with signal 9 |
9 | Runtime error | 168 ms | 262144 KB | Execution killed with signal 9 |
10 | Runtime error | 232 ms | 262144 KB | Execution killed with signal 9 |
11 | Runtime error | 180 ms | 262144 KB | Execution killed with signal 9 |
12 | Runtime error | 170 ms | 262144 KB | Execution killed with signal 9 |
13 | Runtime error | 263 ms | 262144 KB | Execution killed with signal 9 |
14 | Runtime error | 242 ms | 262144 KB | Execution killed with signal 9 |
15 | Runtime error | 208 ms | 262144 KB | Execution killed with signal 9 |
16 | Runtime error | 216 ms | 262144 KB | Execution killed with signal 9 |
17 | Runtime error | 207 ms | 262144 KB | Execution killed with signal 9 |
18 | Runtime error | 189 ms | 262144 KB | Execution killed with signal 9 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 221 ms | 262144 KB | Execution killed with signal 9 |
2 | Runtime error | 244 ms | 262144 KB | Execution killed with signal 9 |
3 | Runtime error | 292 ms | 262144 KB | Execution killed with signal 9 |
4 | Runtime error | 276 ms | 262144 KB | Execution killed with signal 9 |
5 | Runtime error | 252 ms | 262144 KB | Execution killed with signal 9 |
6 | Runtime error | 214 ms | 262144 KB | Execution killed with signal 9 |
7 | Runtime error | 215 ms | 262144 KB | Execution killed with signal 9 |
8 | Runtime error | 227 ms | 262144 KB | Execution killed with signal 9 |
9 | Runtime error | 269 ms | 262144 KB | Execution killed with signal 9 |
10 | Runtime error | 269 ms | 262144 KB | Execution killed with signal 9 |
11 | Runtime error | 269 ms | 262144 KB | Execution killed with signal 9 |
12 | Runtime error | 268 ms | 262144 KB | Execution killed with signal 9 |
13 | Runtime error | 219 ms | 262144 KB | Execution killed with signal 9 |
14 | Runtime error | 251 ms | 262144 KB | Execution killed with signal 9 |
15 | Runtime error | 257 ms | 262144 KB | Execution killed with signal 9 |
16 | Runtime error | 218 ms | 262144 KB | Execution killed with signal 9 |
17 | Runtime error | 285 ms | 262144 KB | Execution killed with signal 9 |
18 | Runtime error | 261 ms | 262144 KB | Execution killed with signal 9 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 267 ms | 262144 KB | Execution killed with signal 9 |
2 | Runtime error | 321 ms | 262144 KB | Execution killed with signal 9 |
3 | Runtime error | 312 ms | 262144 KB | Execution killed with signal 9 |
4 | Runtime error | 291 ms | 262144 KB | Execution killed with signal 9 |
5 | Runtime error | 264 ms | 262144 KB | Execution killed with signal 9 |
6 | Runtime error | 330 ms | 262144 KB | Execution killed with signal 9 |
7 | Runtime error | 310 ms | 262144 KB | Execution killed with signal 9 |
8 | Runtime error | 291 ms | 262144 KB | Execution killed with signal 9 |
9 | Runtime error | 290 ms | 262144 KB | Execution killed with signal 9 |
10 | Runtime error | 330 ms | 262144 KB | Execution killed with signal 9 |
11 | Runtime error | 281 ms | 262144 KB | Execution killed with signal 9 |
12 | Runtime error | 287 ms | 262144 KB | Execution killed with signal 9 |
13 | Runtime error | 275 ms | 262144 KB | Execution killed with signal 9 |
14 | Runtime error | 219 ms | 262144 KB | Execution killed with signal 9 |
15 | Runtime error | 258 ms | 262144 KB | Execution killed with signal 9 |
16 | Runtime error | 262 ms | 262144 KB | Execution killed with signal 9 |
17 | Runtime error | 275 ms | 262144 KB | Execution killed with signal 9 |
18 | Runtime error | 286 ms | 262144 KB | Execution killed with signal 9 |
19 | Runtime error | 217 ms | 262144 KB | Execution killed with signal 9 |
20 | Runtime error | 310 ms | 262144 KB | Execution killed with signal 9 |
21 | Runtime error | 245 ms | 262144 KB | Execution killed with signal 9 |
22 | Runtime error | 285 ms | 262144 KB | Execution killed with signal 9 |
23 | Runtime error | 272 ms | 262144 KB | Execution killed with signal 9 |
24 | Runtime error | 233 ms | 262144 KB | Execution killed with signal 9 |
25 | Runtime error | 280 ms | 262144 KB | Execution killed with signal 9 |
26 | Runtime error | 271 ms | 262144 KB | Execution killed with signal 9 |
27 | Runtime error | 281 ms | 262144 KB | Execution killed with signal 9 |
28 | Runtime error | 220 ms | 262144 KB | Execution killed with signal 9 |
29 | Runtime error | 287 ms | 262144 KB | Execution killed with signal 9 |
30 | Runtime error | 289 ms | 262144 KB | Execution killed with signal 9 |
31 | Runtime error | 257 ms | 262144 KB | Execution killed with signal 9 |
32 | Runtime error | 262 ms | 262144 KB | Execution killed with signal 9 |
33 | Runtime error | 195 ms | 262144 KB | Execution killed with signal 9 |
34 | Runtime error | 310 ms | 262144 KB | Execution killed with signal 9 |
35 | Runtime error | 251 ms | 262144 KB | Execution killed with signal 9 |
36 | Runtime error | 296 ms | 262144 KB | Execution killed with signal 9 |
37 | Runtime error | 248 ms | 262144 KB | Execution killed with signal 9 |
38 | Runtime error | 279 ms | 262144 KB | Execution killed with signal 9 |
39 | Runtime error | 231 ms | 262144 KB | Execution killed with signal 9 |
40 | Runtime error | 284 ms | 262144 KB | Execution killed with signal 9 |
41 | Runtime error | 296 ms | 262144 KB | Execution killed with signal 9 |
42 | Runtime error | 318 ms | 262144 KB | Execution killed with signal 9 |