Submission #925226

# Submission time Handle Problem Language Result Execution time Memory
925226 2024-02-11T06:49:14 Z 12345678 Brunhilda’s Birthday (BOI13_brunhilda) C++17
3.33333 / 100
191 ms 159364 KB
#include <bits/stdc++.h>

using namespace std;

const int nx=1e7+5;
int dp[nx], n, m, x, q, p, res[nx], t, cnt;

int main()
{
    cin.tie(NULL)->sync_with_stdio(false);
    cin>>m>>q;
    for (int i=0; i<m; i++)
    {
        cin>>x;
        for (int j=x; j<nx; j+=x) dp[j]=x;
    }
    for (int i=x; i<nx; i++) res[i]=-1;
    t=1;
    while (p<nx)
    {
        int mx=x;
        t++;
        for (int i=p; i<x; i++) mx=max(mx, i+dp[i]);
        for (int i=x; i<mx; i++) res[i]=t;
        if (mx==x) break;
        p=x;
        x=mx;
    }
    while (q--)
    {
        cin>>x;
        if (res[x]==-1) cout<<"oo\n";
        else cout<<res[x]<<'\n';
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 28 ms 78680 KB Output isn't correct
2 Runtime error 105 ms 159364 KB Execution killed with signal 11
3 Correct 20 ms 78680 KB Output is correct
4 Runtime error 91 ms 159144 KB Execution killed with signal 11
5 Runtime error 100 ms 159112 KB Execution killed with signal 11
6 Incorrect 18 ms 78684 KB Output isn't correct
7 Correct 20 ms 78672 KB Output is correct
8 Correct 23 ms 78736 KB Output is correct
9 Runtime error 113 ms 159060 KB Execution killed with signal 11
10 Runtime error 121 ms 159100 KB Execution killed with signal 11
11 Runtime error 139 ms 159092 KB Execution killed with signal 11
12 Runtime error 91 ms 159052 KB Execution killed with signal 11
13 Runtime error 152 ms 159056 KB Execution killed with signal 11
14 Runtime error 153 ms 159116 KB Execution killed with signal 11
15 Runtime error 120 ms 159316 KB Execution killed with signal 11
16 Runtime error 100 ms 159060 KB Execution killed with signal 11
17 Runtime error 101 ms 159316 KB Execution killed with signal 11
18 Runtime error 89 ms 159060 KB Execution killed with signal 11
# Verdict Execution time Memory Grader output
1 Runtime error 92 ms 154664 KB Execution killed with signal 11
2 Runtime error 82 ms 88812 KB Execution killed with signal 11
3 Runtime error 165 ms 142812 KB Execution killed with signal 11
4 Runtime error 101 ms 158880 KB Execution killed with signal 11
5 Runtime error 162 ms 150864 KB Execution killed with signal 11
6 Runtime error 97 ms 158808 KB Execution killed with signal 11
7 Runtime error 91 ms 154704 KB Execution killed with signal 11
8 Runtime error 110 ms 159056 KB Execution killed with signal 11
9 Runtime error 147 ms 150864 KB Execution killed with signal 11
10 Runtime error 169 ms 142616 KB Execution killed with signal 11
11 Runtime error 163 ms 154960 KB Execution killed with signal 11
12 Runtime error 123 ms 158736 KB Execution killed with signal 11
13 Runtime error 90 ms 158800 KB Execution killed with signal 11
14 Runtime error 106 ms 159056 KB Execution killed with signal 11
15 Runtime error 156 ms 154948 KB Execution killed with signal 11
16 Runtime error 76 ms 88660 KB Execution killed with signal 11
17 Runtime error 154 ms 158804 KB Execution killed with signal 11
18 Runtime error 140 ms 121992 KB Execution killed with signal 11
# Verdict Execution time Memory Grader output
1 Runtime error 147 ms 155220 KB Execution killed with signal 11
2 Runtime error 174 ms 155152 KB Execution killed with signal 11
3 Runtime error 172 ms 155104 KB Execution killed with signal 11
4 Runtime error 125 ms 158804 KB Execution killed with signal 11
5 Runtime error 94 ms 126292 KB Execution killed with signal 11
6 Runtime error 146 ms 159144 KB Execution killed with signal 11
7 Runtime error 144 ms 138776 KB Execution killed with signal 11
8 Runtime error 152 ms 155036 KB Execution killed with signal 11
9 Runtime error 149 ms 155016 KB Execution killed with signal 11
10 Runtime error 149 ms 158800 KB Execution killed with signal 11
11 Runtime error 122 ms 158972 KB Execution killed with signal 11
12 Runtime error 140 ms 159212 KB Execution killed with signal 11
13 Runtime error 166 ms 154928 KB Execution killed with signal 11
14 Runtime error 131 ms 159312 KB Execution killed with signal 11
15 Runtime error 150 ms 158860 KB Execution killed with signal 11
16 Runtime error 157 ms 159032 KB Execution killed with signal 11
17 Runtime error 148 ms 155160 KB Execution killed with signal 11
18 Runtime error 191 ms 155056 KB Execution killed with signal 11
19 Runtime error 91 ms 154708 KB Execution killed with signal 11
20 Runtime error 174 ms 155220 KB Execution killed with signal 11
21 Runtime error 132 ms 159172 KB Execution killed with signal 11
22 Runtime error 177 ms 151376 KB Execution killed with signal 11
23 Runtime error 101 ms 154960 KB Execution killed with signal 11
24 Runtime error 89 ms 158864 KB Execution killed with signal 11
25 Runtime error 123 ms 158856 KB Execution killed with signal 11
26 Runtime error 123 ms 158804 KB Execution killed with signal 11
27 Runtime error 190 ms 147412 KB Execution killed with signal 11
28 Runtime error 94 ms 158800 KB Execution killed with signal 11
29 Runtime error 169 ms 151436 KB Execution killed with signal 11
30 Runtime error 154 ms 155188 KB Execution killed with signal 11
31 Runtime error 101 ms 158860 KB Execution killed with signal 11
32 Runtime error 107 ms 158804 KB Execution killed with signal 11
33 Runtime error 85 ms 158740 KB Execution killed with signal 11
34 Runtime error 154 ms 138888 KB Execution killed with signal 11
35 Runtime error 96 ms 158800 KB Execution killed with signal 11
36 Runtime error 180 ms 151452 KB Execution killed with signal 11
37 Runtime error 100 ms 126288 KB Execution killed with signal 11
38 Runtime error 146 ms 159116 KB Execution killed with signal 11
39 Runtime error 97 ms 158800 KB Execution killed with signal 11
40 Runtime error 134 ms 159112 KB Execution killed with signal 11
41 Runtime error 122 ms 105704 KB Execution killed with signal 11
42 Runtime error 157 ms 158896 KB Execution killed with signal 11