답안 #478815

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
478815 2021-10-08T13:04:43 Z David_M Brunhilda’s Birthday (BOI13_brunhilda) C++17
0 / 100
44 ms 1176 KB
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll N=1e1;
ll m, q, x, u=N, a[N+5], b[N+5], j;
main(){
	cin>>m>>q;
	for (int i=1; i<=u+1; i++)a[i]=b[i]=u;
	for (int i=1; i<=m&&!(j*=0); i++)
        for (cin>>x; j<=u+1; j+=x)a[j-1]=min(a[j-1],j-x);
	for (int i=u; i; i--)a[u]=min(a[u],a[u+1]);
	for (int i=1; i<=u; i++)b[i]=b[a[i]]+1;
	while(cin>>x)
        if(b[x]<u)cout<<b[x]<<'\n';
        else cout<<"oo\n";
}

Compilation message

brunhilda.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 336 KB Execution killed with signal 11
2 Runtime error 1 ms 336 KB Execution killed with signal 11
3 Runtime error 1 ms 336 KB Execution killed with signal 11
4 Runtime error 5 ms 472 KB Execution killed with signal 11
5 Incorrect 1 ms 208 KB Output isn't correct
6 Runtime error 1 ms 336 KB Execution killed with signal 11
7 Runtime error 1 ms 336 KB Execution killed with signal 11
8 Runtime error 1 ms 336 KB Execution killed with signal 11
9 Incorrect 1 ms 208 KB Output isn't correct
10 Runtime error 1 ms 336 KB Execution killed with signal 11
11 Runtime error 1 ms 336 KB Execution killed with signal 11
12 Runtime error 1 ms 336 KB Execution killed with signal 11
13 Runtime error 1 ms 336 KB Execution killed with signal 11
14 Runtime error 7 ms 352 KB Execution killed with signal 11
15 Runtime error 1 ms 336 KB Execution killed with signal 11
16 Runtime error 1 ms 336 KB Execution killed with signal 11
17 Runtime error 5 ms 464 KB Execution killed with signal 11
18 Runtime error 4 ms 464 KB Execution killed with signal 11
# 결과 실행 시간 메모리 Grader output
1 Runtime error 5 ms 464 KB Execution killed with signal 11
2 Runtime error 36 ms 1032 KB Execution killed with signal 11
3 Runtime error 24 ms 792 KB Execution killed with signal 11
4 Runtime error 2 ms 336 KB Execution killed with signal 11
5 Runtime error 24 ms 652 KB Execution killed with signal 11
6 Runtime error 1 ms 336 KB Execution killed with signal 11
7 Runtime error 5 ms 464 KB Execution killed with signal 11
8 Runtime error 1 ms 336 KB Execution killed with signal 11
9 Runtime error 25 ms 840 KB Execution killed with signal 11
10 Runtime error 25 ms 756 KB Execution killed with signal 11
11 Runtime error 14 ms 592 KB Execution killed with signal 11
12 Runtime error 1 ms 336 KB Execution killed with signal 11
13 Runtime error 2 ms 336 KB Execution killed with signal 11
14 Runtime error 2 ms 336 KB Execution killed with signal 11
15 Runtime error 14 ms 568 KB Execution killed with signal 11
16 Runtime error 33 ms 1036 KB Execution killed with signal 11
17 Runtime error 2 ms 316 KB Execution killed with signal 11
18 Runtime error 34 ms 1024 KB Execution killed with signal 11
# 결과 실행 시간 메모리 Grader output
1 Runtime error 18 ms 784 KB Execution killed with signal 11
2 Runtime error 18 ms 840 KB Execution killed with signal 11
3 Runtime error 18 ms 792 KB Execution killed with signal 11
4 Runtime error 2 ms 464 KB Execution killed with signal 11
5 Runtime error 37 ms 1164 KB Execution killed with signal 11
6 Runtime error 3 ms 592 KB Execution killed with signal 11
7 Runtime error 36 ms 1164 KB Execution killed with signal 11
8 Runtime error 18 ms 784 KB Execution killed with signal 11
9 Runtime error 22 ms 784 KB Execution killed with signal 11
10 Runtime error 3 ms 504 KB Execution killed with signal 11
11 Runtime error 2 ms 464 KB Execution killed with signal 11
12 Runtime error 3 ms 464 KB Execution killed with signal 11
13 Runtime error 11 ms 664 KB Execution killed with signal 11
14 Runtime error 1 ms 336 KB Execution killed with signal 11
15 Runtime error 2 ms 464 KB Execution killed with signal 11
16 Runtime error 3 ms 436 KB Execution killed with signal 11
17 Runtime error 15 ms 720 KB Execution killed with signal 11
18 Runtime error 18 ms 784 KB Execution killed with signal 11
19 Runtime error 2 ms 464 KB Execution killed with signal 11
20 Runtime error 17 ms 792 KB Execution killed with signal 11
21 Runtime error 1 ms 464 KB Execution killed with signal 11
22 Runtime error 34 ms 1176 KB Execution killed with signal 11
23 Runtime error 11 ms 660 KB Execution killed with signal 11
24 Runtime error 1 ms 336 KB Execution killed with signal 11
25 Runtime error 2 ms 464 KB Execution killed with signal 11
26 Runtime error 3 ms 464 KB Execution killed with signal 11
27 Runtime error 44 ms 1156 KB Execution killed with signal 11
28 Runtime error 1 ms 336 KB Execution killed with signal 11
29 Runtime error 35 ms 1148 KB Execution killed with signal 11
30 Runtime error 26 ms 908 KB Execution killed with signal 11
31 Runtime error 2 ms 464 KB Execution killed with signal 11
32 Runtime error 2 ms 464 KB Execution killed with signal 11
33 Runtime error 1 ms 336 KB Execution killed with signal 11
34 Runtime error 36 ms 1164 KB Execution killed with signal 11
35 Runtime error 1 ms 340 KB Execution killed with signal 11
36 Runtime error 32 ms 1172 KB Execution killed with signal 11
37 Runtime error 36 ms 1164 KB Execution killed with signal 11
38 Runtime error 4 ms 596 KB Execution killed with signal 11
39 Runtime error 3 ms 468 KB Execution killed with signal 11
40 Runtime error 4 ms 592 KB Execution killed with signal 11
41 Runtime error 43 ms 1168 KB Execution killed with signal 11
42 Runtime error 2 ms 468 KB Execution killed with signal 11