# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1109612 | 2024-11-07T07:09:31 Z | 0pt1mus23 | Brunhilda’s Birthday (BOI13_brunhilda) | C++14 | 380 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<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); mx=max(mx,p); } for(int i =1;i<sze;i++){ dp[i]=inf; for(auto v:event[i]){ if(i!=v){ ans.erase(ans.find(dp[i - v])); } } 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 < sze){ event[i + v].pb(v); } } } event[i].clear(); } 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; }
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 130 ms | 262144 KB | Execution killed with signal 9 |
2 | Runtime error | 213 ms | 262144 KB | Execution killed with signal 9 |
3 | Runtime error | 143 ms | 262144 KB | Execution killed with signal 9 |
4 | Runtime error | 177 ms | 262144 KB | Execution killed with signal 9 |
5 | Runtime error | 185 ms | 262144 KB | Execution killed with signal 9 |
6 | Runtime error | 140 ms | 262144 KB | Execution killed with signal 9 |
7 | Runtime error | 138 ms | 262144 KB | Execution killed with signal 9 |
8 | Runtime error | 170 ms | 262144 KB | Execution killed with signal 9 |
9 | Runtime error | 221 ms | 262144 KB | Execution killed with signal 9 |
10 | Runtime error | 217 ms | 262144 KB | Execution killed with signal 9 |
11 | Runtime error | 207 ms | 262144 KB | Execution killed with signal 9 |
12 | Runtime error | 165 ms | 262144 KB | Execution killed with signal 9 |
13 | Runtime error | 296 ms | 262144 KB | Execution killed with signal 9 |
14 | Runtime error | 309 ms | 262144 KB | Execution killed with signal 9 |
15 | Runtime error | 228 ms | 262144 KB | Execution killed with signal 9 |
16 | Runtime error | 224 ms | 262144 KB | Execution killed with signal 9 |
17 | Runtime error | 209 ms | 262144 KB | Execution killed with signal 9 |
18 | Runtime error | 202 ms | 262144 KB | Execution killed with signal 9 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 224 ms | 262144 KB | Execution killed with signal 9 |
2 | Runtime error | 229 ms | 262144 KB | Execution killed with signal 9 |
3 | Runtime error | 352 ms | 262144 KB | Execution killed with signal 9 |
4 | Runtime error | 259 ms | 262144 KB | Execution killed with signal 9 |
5 | Runtime error | 293 ms | 262144 KB | Execution killed with signal 9 |
6 | Runtime error | 248 ms | 262144 KB | Execution killed with signal 9 |
7 | Runtime error | 217 ms | 262144 KB | Execution killed with signal 9 |
8 | Runtime error | 244 ms | 262144 KB | Execution killed with signal 9 |
9 | Runtime error | 316 ms | 262144 KB | Execution killed with signal 9 |
10 | Runtime error | 315 ms | 262144 KB | Execution killed with signal 9 |
11 | Runtime error | 340 ms | 262144 KB | Execution killed with signal 9 |
12 | Runtime error | 256 ms | 262144 KB | Execution killed with signal 9 |
13 | Runtime error | 210 ms | 262144 KB | Execution killed with signal 9 |
14 | Runtime error | 261 ms | 262144 KB | Execution killed with signal 9 |
15 | Runtime error | 315 ms | 262144 KB | Execution killed with signal 9 |
16 | Runtime error | 234 ms | 262144 KB | Execution killed with signal 9 |
17 | Runtime error | 321 ms | 262144 KB | Execution killed with signal 9 |
18 | Runtime error | 298 ms | 262144 KB | Execution killed with signal 9 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 334 ms | 262144 KB | Execution killed with signal 9 |
2 | Runtime error | 380 ms | 262144 KB | Execution killed with signal 9 |
3 | Runtime error | 333 ms | 262144 KB | Execution killed with signal 9 |
4 | Runtime error | 290 ms | 262144 KB | Execution killed with signal 9 |
5 | Runtime error | 253 ms | 262144 KB | Execution killed with signal 9 |
6 | Runtime error | 343 ms | 262144 KB | Execution killed with signal 9 |
7 | Runtime error | 266 ms | 262144 KB | Execution killed with signal 9 |
8 | Runtime error | 341 ms | 262144 KB | Execution killed with signal 9 |
9 | Runtime error | 329 ms | 262144 KB | Execution killed with signal 9 |
10 | Runtime error | 296 ms | 262144 KB | Execution killed with signal 9 |
11 | Runtime error | 290 ms | 262144 KB | Execution killed with signal 9 |
12 | Runtime error | 321 ms | 262144 KB | Execution killed with signal 9 |
13 | Runtime error | 341 ms | 262144 KB | Execution killed with signal 9 |
14 | Runtime error | 240 ms | 262144 KB | Execution killed with signal 9 |
15 | Runtime error | 315 ms | 262144 KB | Execution killed with signal 9 |
16 | Runtime error | 332 ms | 262144 KB | Execution killed with signal 9 |
17 | Runtime error | 269 ms | 262144 KB | Execution killed with signal 9 |
18 | Runtime error | 348 ms | 262144 KB | Execution killed with signal 9 |
19 | Runtime error | 221 ms | 262144 KB | Execution killed with signal 9 |
20 | Runtime error | 347 ms | 262144 KB | Execution killed with signal 9 |
21 | Runtime error | 285 ms | 262144 KB | Execution killed with signal 9 |
22 | Runtime error | 346 ms | 262144 KB | Execution killed with signal 9 |
23 | Runtime error | 223 ms | 262144 KB | Execution killed with signal 9 |
24 | Runtime error | 196 ms | 262144 KB | Execution killed with signal 9 |
25 | Runtime error | 278 ms | 262144 KB | Execution killed with signal 9 |
26 | Runtime error | 288 ms | 262144 KB | Execution killed with signal 9 |
27 | Runtime error | 332 ms | 262144 KB | Execution killed with signal 9 |
28 | Runtime error | 199 ms | 262144 KB | Execution killed with signal 9 |
29 | Runtime error | 272 ms | 262144 KB | Execution killed with signal 9 |
30 | Runtime error | 248 ms | 262144 KB | Execution killed with signal 9 |
31 | Runtime error | 229 ms | 262144 KB | Execution killed with signal 9 |
32 | Runtime error | 248 ms | 262144 KB | Execution killed with signal 9 |
33 | Runtime error | 161 ms | 262144 KB | Execution killed with signal 9 |
34 | Runtime error | 240 ms | 262144 KB | Execution killed with signal 9 |
35 | Runtime error | 206 ms | 262144 KB | Execution killed with signal 9 |
36 | Runtime error | 298 ms | 262144 KB | Execution killed with signal 9 |
37 | Runtime error | 210 ms | 262144 KB | Execution killed with signal 9 |
38 | Runtime error | 329 ms | 262144 KB | Execution killed with signal 9 |
39 | Runtime error | 221 ms | 262144 KB | Execution killed with signal 9 |
40 | Runtime error | 337 ms | 262144 KB | Execution killed with signal 9 |
41 | Runtime error | 288 ms | 262144 KB | Execution killed with signal 9 |
42 | Runtime error | 325 ms | 262144 KB | Execution killed with signal 9 |