# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
559463 | 2022-05-09T22:45:17 Z | Trunkty | Brunhilda’s Birthday (BOI13_brunhilda) | C++14 | 230 ms | 262144 KB |
#include <iostream> #include <vector> #include <algorithm> using namespace std; typedef long long ll; #define DEBUG #ifdef DEBUG #define debug(x) cout << #x << ": " << x << endl #else #define debug(x) #endif int m,q; vector<int> upd[10000005]; int cnt[10000005]; int curr[10000005]; int ans[10000005],lp=0,maxi=2e9; int main(){ ios::sync_with_stdio(false); cin.tie(NULL); cin >> m >> q; for(int i=1;i<=m;i++){ int a; cin >> a; for(int j=a;j<=1e7;j+=a){ upd[j].push_back(a); } cnt[0]++; } for(int i=1;i<=1e7;i++){ for(int j:upd[i]){ cnt[curr[j]]--; curr[j] = i; cnt[curr[j]]++; } while(lp!=i and !cnt[lp]){ lp++; } if(lp==i){ maxi = i; break; } ans[i] = ans[lp]+1; } for(int i=1;i<=q;i++){ int a; cin >> a; if(a<maxi){ cout << ans[a] << "\n"; } else{ cout << "oo" << "\n"; } } return 0; }
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 183 ms | 262144 KB | Execution killed with signal 9 |
2 | Runtime error | 129 ms | 262144 KB | Execution killed with signal 9 |
3 | Runtime error | 124 ms | 262144 KB | Execution killed with signal 9 |
4 | Runtime error | 187 ms | 262144 KB | Execution killed with signal 9 |
5 | Runtime error | 134 ms | 262144 KB | Execution killed with signal 9 |
6 | Runtime error | 139 ms | 262144 KB | Execution killed with signal 9 |
7 | Runtime error | 126 ms | 262144 KB | Execution killed with signal 9 |
8 | Runtime error | 125 ms | 262144 KB | Execution killed with signal 9 |
9 | Runtime error | 128 ms | 262144 KB | Execution killed with signal 9 |
10 | Runtime error | 124 ms | 262144 KB | Execution killed with signal 9 |
11 | Runtime error | 120 ms | 262144 KB | Execution killed with signal 9 |
12 | Runtime error | 194 ms | 262144 KB | Execution killed with signal 9 |
13 | Runtime error | 119 ms | 262144 KB | Execution killed with signal 9 |
14 | Runtime error | 121 ms | 262144 KB | Execution killed with signal 9 |
15 | Runtime error | 132 ms | 262144 KB | Execution killed with signal 9 |
16 | Runtime error | 124 ms | 262144 KB | Execution killed with signal 9 |
17 | Runtime error | 153 ms | 262144 KB | Execution killed with signal 9 |
18 | Runtime error | 190 ms | 262144 KB | Execution killed with signal 9 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 199 ms | 262144 KB | Execution killed with signal 9 |
2 | Runtime error | 152 ms | 262144 KB | Execution killed with signal 9 |
3 | Runtime error | 129 ms | 262144 KB | Execution killed with signal 9 |
4 | Runtime error | 123 ms | 262144 KB | Execution killed with signal 9 |
5 | Runtime error | 137 ms | 262144 KB | Execution killed with signal 9 |
6 | Runtime error | 123 ms | 262144 KB | Execution killed with signal 9 |
7 | Runtime error | 200 ms | 262144 KB | Execution killed with signal 9 |
8 | Runtime error | 140 ms | 262144 KB | Execution killed with signal 9 |
9 | Runtime error | 123 ms | 262144 KB | Execution killed with signal 9 |
10 | Runtime error | 123 ms | 262144 KB | Execution killed with signal 9 |
11 | Runtime error | 133 ms | 262144 KB | Execution killed with signal 9 |
12 | Runtime error | 123 ms | 262144 KB | Execution killed with signal 9 |
13 | Runtime error | 120 ms | 262144 KB | Execution killed with signal 9 |
14 | Runtime error | 127 ms | 262144 KB | Execution killed with signal 9 |
15 | Runtime error | 120 ms | 262144 KB | Execution killed with signal 9 |
16 | Runtime error | 148 ms | 262144 KB | Execution killed with signal 9 |
17 | Runtime error | 129 ms | 262144 KB | Execution killed with signal 9 |
18 | Runtime error | 120 ms | 262144 KB | Execution killed with signal 9 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 126 ms | 262144 KB | Execution killed with signal 9 |
2 | Runtime error | 119 ms | 262144 KB | Execution killed with signal 9 |
3 | Runtime error | 123 ms | 262144 KB | Execution killed with signal 9 |
4 | Runtime error | 135 ms | 262144 KB | Execution killed with signal 9 |
5 | Runtime error | 225 ms | 262144 KB | Execution killed with signal 9 |
6 | Runtime error | 120 ms | 262144 KB | Execution killed with signal 9 |
7 | Runtime error | 135 ms | 262144 KB | Execution killed with signal 9 |
8 | Runtime error | 133 ms | 262144 KB | Execution killed with signal 9 |
9 | Runtime error | 123 ms | 262144 KB | Execution killed with signal 9 |
10 | Runtime error | 128 ms | 262144 KB | Execution killed with signal 9 |
11 | Runtime error | 122 ms | 262144 KB | Execution killed with signal 9 |
12 | Runtime error | 121 ms | 262144 KB | Execution killed with signal 9 |
13 | Runtime error | 126 ms | 262144 KB | Execution killed with signal 9 |
14 | Runtime error | 122 ms | 262144 KB | Execution killed with signal 9 |
15 | Runtime error | 121 ms | 262144 KB | Execution killed with signal 9 |
16 | Runtime error | 120 ms | 262144 KB | Execution killed with signal 9 |
17 | Runtime error | 123 ms | 262144 KB | Execution killed with signal 9 |
18 | Runtime error | 123 ms | 262144 KB | Execution killed with signal 9 |
19 | Runtime error | 121 ms | 262144 KB | Execution killed with signal 9 |
20 | Runtime error | 119 ms | 262144 KB | Execution killed with signal 9 |
21 | Runtime error | 122 ms | 262144 KB | Execution killed with signal 9 |
22 | Runtime error | 122 ms | 262144 KB | Execution killed with signal 9 |
23 | Runtime error | 223 ms | 262144 KB | Execution killed with signal 9 |
24 | Runtime error | 144 ms | 262144 KB | Execution killed with signal 9 |
25 | Runtime error | 127 ms | 262144 KB | Execution killed with signal 9 |
26 | Runtime error | 121 ms | 262144 KB | Execution killed with signal 9 |
27 | Runtime error | 124 ms | 262144 KB | Execution killed with signal 9 |
28 | Runtime error | 127 ms | 262144 KB | Execution killed with signal 9 |
29 | Runtime error | 136 ms | 262144 KB | Execution killed with signal 9 |
30 | Runtime error | 143 ms | 262144 KB | Execution killed with signal 9 |
31 | Runtime error | 129 ms | 262144 KB | Execution killed with signal 9 |
32 | Runtime error | 130 ms | 262144 KB | Execution killed with signal 9 |
33 | Runtime error | 170 ms | 262144 KB | Execution killed with signal 9 |
34 | Runtime error | 143 ms | 262144 KB | Execution killed with signal 9 |
35 | Runtime error | 121 ms | 262144 KB | Execution killed with signal 9 |
36 | Runtime error | 120 ms | 262144 KB | Execution killed with signal 9 |
37 | Runtime error | 230 ms | 262144 KB | Execution killed with signal 9 |
38 | Runtime error | 125 ms | 262144 KB | Execution killed with signal 9 |
39 | Runtime error | 147 ms | 262144 KB | Execution killed with signal 9 |
40 | Runtime error | 122 ms | 262144 KB | Execution killed with signal 9 |
41 | Runtime error | 120 ms | 262144 KB | Execution killed with signal 9 |
42 | Runtime error | 120 ms | 262144 KB | Execution killed with signal 9 |