답안 #27733

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
27733 2017-07-13T14:28:50 Z top34051 Brunhilda’s Birthday (BOI13_brunhilda) C++14
97.7778 / 100
426 ms 119596 KB
#include<bits/stdc++.h>
using namespace std;
#define inf (int)1e6
int n,m;
int p[100005];
int mx[10000005];
int mem[20000005];
main() {
    int i,j,x,val;
    scanf("%d%d",&n,&m);
    for(i=1;i<=n;i++) {
        scanf("%d",&val);
        x = 0;
        while(x<=10000000) {
            mx[x] = max(mx[x],val);
            x += val;
        }
    }
    for(i=0,j=1;i<=10000000;i++) for(j=max(j,i+1);j<i+mx[i];j++) mem[j] = mem[i]+1;
    while(m--) {
        scanf("%d",&x);
        if(x>=j) printf("oo\n");
        else printf("%d\n",mem[x]);
    }
}

Compilation message

brunhilda.cpp:8:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main() {
      ^
brunhilda.cpp: In function 'int main()':
brunhilda.cpp:10:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&n,&m);
                        ^
brunhilda.cpp:12:25: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&val);
                         ^
brunhilda.cpp:21:23: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&x);
                       ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 66 ms 119596 KB Output isn't correct
2 Correct 69 ms 119596 KB Output is correct
3 Correct 79 ms 119596 KB Output is correct
4 Correct 49 ms 119596 KB Output is correct
5 Correct 66 ms 119596 KB Output is correct
6 Incorrect 39 ms 119596 KB Output isn't correct
7 Correct 66 ms 119596 KB Output is correct
8 Correct 43 ms 119596 KB Output is correct
9 Correct 103 ms 119596 KB Output is correct
10 Correct 103 ms 119596 KB Output is correct
11 Correct 116 ms 119596 KB Output is correct
12 Correct 46 ms 119596 KB Output is correct
13 Correct 236 ms 119596 KB Output is correct
14 Correct 256 ms 119596 KB Output is correct
15 Correct 76 ms 119596 KB Output is correct
16 Correct 63 ms 119596 KB Output is correct
17 Correct 79 ms 119596 KB Output is correct
18 Correct 43 ms 119596 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 53 ms 119596 KB Output is correct
2 Correct 103 ms 119596 KB Output is correct
3 Correct 319 ms 119596 KB Output is correct
4 Correct 99 ms 119596 KB Output is correct
5 Correct 219 ms 119596 KB Output is correct
6 Correct 86 ms 119596 KB Output is correct
7 Correct 59 ms 119596 KB Output is correct
8 Correct 83 ms 119596 KB Output is correct
9 Correct 223 ms 119596 KB Output is correct
10 Correct 296 ms 119596 KB Output is correct
11 Correct 283 ms 119596 KB Output is correct
12 Correct 126 ms 119596 KB Output is correct
13 Correct 33 ms 119596 KB Output is correct
14 Correct 93 ms 119596 KB Output is correct
15 Correct 186 ms 119596 KB Output is correct
16 Correct 103 ms 119596 KB Output is correct
17 Correct 249 ms 119596 KB Output is correct
18 Correct 253 ms 119596 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 286 ms 119596 KB Output is correct
2 Correct 323 ms 119596 KB Output is correct
3 Correct 313 ms 119596 KB Output is correct
4 Correct 199 ms 119596 KB Output is correct
5 Correct 159 ms 119596 KB Output is correct
6 Correct 276 ms 119596 KB Output is correct
7 Correct 239 ms 119596 KB Output is correct
8 Correct 283 ms 119596 KB Output is correct
9 Correct 273 ms 119596 KB Output is correct
10 Correct 186 ms 119596 KB Output is correct
11 Correct 166 ms 119596 KB Output is correct
12 Correct 226 ms 119596 KB Output is correct
13 Correct 319 ms 119596 KB Output is correct
14 Correct 166 ms 119596 KB Output is correct
15 Correct 233 ms 119596 KB Output is correct
16 Correct 299 ms 119596 KB Output is correct
17 Correct 263 ms 119596 KB Output is correct
18 Correct 363 ms 119596 KB Output is correct
19 Correct 96 ms 119596 KB Output is correct
20 Correct 333 ms 119596 KB Output is correct
21 Correct 203 ms 119596 KB Output is correct
22 Correct 263 ms 119596 KB Output is correct
23 Correct 139 ms 119596 KB Output is correct
24 Correct 99 ms 119596 KB Output is correct
25 Correct 243 ms 119596 KB Output is correct
26 Correct 173 ms 119596 KB Output is correct
27 Correct 426 ms 119596 KB Output is correct
28 Correct 103 ms 119596 KB Output is correct
29 Correct 373 ms 119596 KB Output is correct
30 Correct 286 ms 119596 KB Output is correct
31 Correct 119 ms 119596 KB Output is correct
32 Correct 166 ms 119596 KB Output is correct
33 Correct 96 ms 119596 KB Output is correct
34 Correct 263 ms 119596 KB Output is correct
35 Correct 113 ms 119596 KB Output is correct
36 Correct 376 ms 119596 KB Output is correct
37 Correct 143 ms 119596 KB Output is correct
38 Correct 286 ms 119596 KB Output is correct
39 Correct 136 ms 119596 KB Output is correct
40 Correct 253 ms 119596 KB Output is correct
41 Correct 203 ms 119596 KB Output is correct
42 Correct 313 ms 119596 KB Output is correct