Submission #478819

# Submission time Handle Problem Language Result Execution time Memory
478819 2021-10-08T13:10:48 Z David_M Brunhilda’s Birthday (BOI13_brunhilda) C++14
0 / 100
418 ms 262144 KB
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll N=1e7;
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+x-1]=min(a[j+x-1],j);
	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(){
      | ^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 126 ms 156948 KB Output isn't correct
2 Incorrect 162 ms 156872 KB Output isn't correct
3 Incorrect 130 ms 156740 KB Output isn't correct
4 Runtime error 271 ms 262144 KB Execution killed with signal 11
5 Incorrect 138 ms 156748 KB Output isn't correct
6 Incorrect 118 ms 156824 KB Output isn't correct
7 Incorrect 130 ms 156828 KB Output isn't correct
8 Incorrect 139 ms 156756 KB Output isn't correct
9 Incorrect 169 ms 156816 KB Output isn't correct
10 Incorrect 193 ms 156772 KB Output isn't correct
11 Incorrect 169 ms 156740 KB Output isn't correct
12 Runtime error 249 ms 262144 KB Execution killed with signal 11
13 Runtime error 382 ms 262144 KB Execution killed with signal 11
14 Runtime error 385 ms 262144 KB Execution killed with signal 11
15 Incorrect 154 ms 156740 KB Output isn't correct
16 Incorrect 146 ms 156824 KB Output isn't correct
17 Incorrect 158 ms 156868 KB Output isn't correct
18 Runtime error 275 ms 262144 KB Execution killed with signal 11
# Verdict Execution time Memory Grader output
1 Runtime error 264 ms 262144 KB Execution killed with signal 11
2 Runtime error 272 ms 262144 KB Execution killed with signal 11
3 Runtime error 389 ms 262144 KB Execution killed with signal 11
4 Runtime error 281 ms 262144 KB Execution killed with signal 11
5 Runtime error 325 ms 262144 KB Execution killed with signal 11
6 Runtime error 266 ms 262144 KB Execution killed with signal 11
7 Runtime error 257 ms 262144 KB Execution killed with signal 11
8 Runtime error 283 ms 262144 KB Execution killed with signal 11
9 Runtime error 336 ms 262144 KB Execution killed with signal 11
10 Runtime error 387 ms 262144 KB Execution killed with signal 11
11 Runtime error 414 ms 262144 KB Execution killed with signal 11
12 Runtime error 330 ms 262144 KB Execution killed with signal 11
13 Runtime error 286 ms 262144 KB Execution killed with signal 11
14 Runtime error 272 ms 262144 KB Execution killed with signal 11
15 Runtime error 347 ms 262144 KB Execution killed with signal 11
16 Runtime error 249 ms 262144 KB Execution killed with signal 11
17 Runtime error 370 ms 262144 KB Execution killed with signal 11
18 Runtime error 342 ms 262144 KB Execution killed with signal 11
# Verdict Execution time Memory Grader output
1 Runtime error 344 ms 262144 KB Execution killed with signal 11
2 Runtime error 368 ms 262144 KB Execution killed with signal 11
3 Runtime error 375 ms 262144 KB Execution killed with signal 11
4 Runtime error 342 ms 262144 KB Execution killed with signal 11
5 Runtime error 247 ms 262144 KB Execution killed with signal 11
6 Runtime error 351 ms 262144 KB Execution killed with signal 11
7 Runtime error 305 ms 262144 KB Execution killed with signal 11
8 Runtime error 346 ms 262144 KB Execution killed with signal 11
9 Runtime error 350 ms 262144 KB Execution killed with signal 11
10 Runtime error 319 ms 262144 KB Execution killed with signal 11
11 Runtime error 313 ms 262144 KB Execution killed with signal 11
12 Runtime error 371 ms 262144 KB Execution killed with signal 11
13 Runtime error 376 ms 262144 KB Execution killed with signal 11
14 Incorrect 376 ms 157140 KB Output isn't correct
15 Runtime error 398 ms 262144 KB Execution killed with signal 11
16 Runtime error 399 ms 262144 KB Execution killed with signal 11
17 Runtime error 331 ms 262144 KB Execution killed with signal 11
18 Runtime error 418 ms 262144 KB Execution killed with signal 11
19 Runtime error 263 ms 262144 KB Execution killed with signal 11
20 Runtime error 370 ms 262144 KB Execution killed with signal 11
21 Incorrect 403 ms 157060 KB Output isn't correct
22 Runtime error 371 ms 262144 KB Execution killed with signal 11
23 Runtime error 244 ms 262144 KB Execution killed with signal 11
24 Runtime error 248 ms 262144 KB Execution killed with signal 11
25 Runtime error 331 ms 262144 KB Execution killed with signal 11
26 Runtime error 321 ms 262144 KB Execution killed with signal 11
27 Runtime error 377 ms 262144 KB Execution killed with signal 11
28 Runtime error 256 ms 262144 KB Execution killed with signal 11
29 Runtime error 355 ms 262144 KB Execution killed with signal 11
30 Runtime error 299 ms 262144 KB Execution killed with signal 11
31 Runtime error 298 ms 262144 KB Execution killed with signal 11
32 Runtime error 290 ms 262144 KB Execution killed with signal 11
33 Runtime error 249 ms 262144 KB Execution killed with signal 11
34 Runtime error 300 ms 262144 KB Execution killed with signal 11
35 Runtime error 259 ms 262144 KB Execution killed with signal 11
36 Runtime error 363 ms 262144 KB Execution killed with signal 11
37 Runtime error 265 ms 262144 KB Execution killed with signal 11
38 Runtime error 366 ms 262144 KB Execution killed with signal 11
39 Runtime error 258 ms 262144 KB Execution killed with signal 11
40 Runtime error 330 ms 262144 KB Execution killed with signal 11
41 Runtime error 298 ms 262144 KB Execution killed with signal 11
42 Runtime error 376 ms 262144 KB Execution killed with signal 11