답안 #31881

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
31881 2017-09-11T08:49:14 Z Kanvie Brunhilda’s Birthday (BOI13_brunhilda) C++14
23.6508 / 100
426 ms 119204 KB
#include<bits/stdc++.h>
using namespace std;
const int M=10000000;
int x,m,q,d[M+5],a[M+5],b[M+5],p,pp,cnt;
int main()
{
    cin>>m>>q;
    for(int i=1;i<=m;++i)cin>>a[i];
    for(int i=1;i<=m;++i)
        for(int j=0;j<=M;j+=a[i])d[j]=max(d[j],a[i]);
    for(int i=0;i<=M;++i)
    {
        while(i<=p)
        {
            if(d[i]!=0)pp=max(pp,i+d[i]-1);
            b[i]=cnt;
            if(i==p)break;
            i++;
        }
        if(i==pp)break;
        p=pp;
        ++cnt;
    }
    while(q--)
    {
        cin>>x;
        if(b[x]==0&&x!=0)cout<<"oo\n";
        else cout<<b[x]<<"\n";
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 23 ms 119204 KB Output is correct
2 Correct 79 ms 119204 KB Output is correct
3 Correct 29 ms 119204 KB Output is correct
4 Correct 73 ms 119204 KB Output is correct
5 Correct 93 ms 119204 KB Output is correct
6 Correct 23 ms 119204 KB Output is correct
7 Correct 36 ms 119204 KB Output is correct
8 Correct 36 ms 119204 KB Output is correct
9 Correct 106 ms 119204 KB Output is correct
10 Correct 99 ms 119204 KB Output is correct
11 Correct 103 ms 119204 KB Output is correct
12 Correct 39 ms 119204 KB Output is correct
13 Correct 236 ms 119204 KB Output is correct
14 Correct 316 ms 119204 KB Output is correct
15 Correct 106 ms 119204 KB Output is correct
16 Correct 103 ms 119204 KB Output is correct
17 Correct 153 ms 119204 KB Output is correct
18 Correct 79 ms 119204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 96 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Runtime error 139 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
3 Runtime error 383 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Runtime error 143 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Runtime error 263 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 86 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 89 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 146 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Runtime error 263 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
10 Runtime error 349 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
11 Runtime error 336 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Correct 179 ms 119204 KB Output is correct
13 Runtime error 63 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
14 Runtime error 153 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
15 Runtime error 243 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
16 Runtime error 136 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
17 Correct 246 ms 119204 KB Output is correct
18 Runtime error 289 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
# 결과 실행 시간 메모리 Grader output
1 Runtime error 259 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Runtime error 346 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
3 Runtime error 356 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Runtime error 329 ms 119204 KB Execution timed out (wall clock limit exceeded)
5 Runtime error 126 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 289 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 299 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 279 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Runtime error 263 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
10 Runtime error 203 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
11 Runtime error 229 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Runtime error 253 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
13 Runtime error 306 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
14 Correct 256 ms 119204 KB Output is correct
15 Runtime error 259 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
16 Runtime error 319 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
17 Runtime error 286 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
18 Runtime error 356 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Runtime error 69 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Runtime error 389 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
21 Runtime error 309 ms 119204 KB Execution timed out (wall clock limit exceeded)
22 Runtime error 426 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
23 Runtime error 156 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
24 Runtime error 66 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
25 Runtime error 196 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
26 Runtime error 343 ms 119204 KB Execution timed out (wall clock limit exceeded)
27 Runtime error 426 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
28 Runtime error 73 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
29 Runtime error 369 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
30 Runtime error 329 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
31 Runtime error 133 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
32 Runtime error 179 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
33 Runtime error 53 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
34 Runtime error 309 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
35 Runtime error 129 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
36 Runtime error 423 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
37 Runtime error 146 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
38 Runtime error 279 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
39 Runtime error 86 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
40 Runtime error 229 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
41 Runtime error 239 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)
42 Runtime error 319 ms 119204 KB Execution killed with signal 11 (could be triggered by violating memory limits)