답안 #160509

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
160509 2019-10-28T08:40:21 Z tushar_2658 Brunhilda’s Birthday (BOI13_brunhilda) C++14
0 / 100
1000 ms 1020 KB
#include "bits/stdc++.h"
using namespace std;

const int maxn = 10005;
int a[maxn], dp[maxn], n, m;

int solve(int x){
    for(int i = 0; i < maxn; i++){
        dp[i] = 1e8;
    }
    dp[0] = 0; 
    for(int i = 1; i <= x; i++){
        for(int j = 1; j <= n; j++){
            dp[i] = min(dp[i], 1 + dp[i - (i % a[j])]);
        }
    }
    return dp[x];
}

int main(int argc, char const *argv[])
{
//    freopen("in.txt", "r", stdin);
    scanf("%d %d", &n, &m); 
    for(int i = 1; i <= n; i++){
        scanf("%d", &a[i]);
    }
    int x; 
    scanf("%d", &x); 
    solve(x);
    printf("%d\n", dp[x]);

    return 0;
}

Compilation message

brunhilda.cpp: In function 'int main(int, const char**)':
brunhilda.cpp:23:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d", &n, &m); 
     ~~~~~^~~~~~~~~~~~~~~~~
brunhilda.cpp:25:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d", &a[i]);
         ~~~~~^~~~~~~~~~~~~
brunhilda.cpp:28:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &x); 
     ~~~~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Incorrect 4 ms 376 KB Output isn't correct
3 Incorrect 2 ms 376 KB Output isn't correct
4 Incorrect 3 ms 376 KB Output isn't correct
5 Incorrect 2 ms 376 KB Output isn't correct
6 Incorrect 2 ms 376 KB Output isn't correct
7 Incorrect 2 ms 376 KB Output isn't correct
8 Incorrect 2 ms 376 KB Output isn't correct
9 Incorrect 2 ms 376 KB Output isn't correct
10 Incorrect 3 ms 376 KB Output isn't correct
11 Incorrect 3 ms 380 KB Output isn't correct
12 Incorrect 3 ms 376 KB Output isn't correct
13 Incorrect 37 ms 376 KB Output isn't correct
14 Incorrect 2 ms 376 KB Output isn't correct
15 Incorrect 3 ms 376 KB Output isn't correct
16 Incorrect 3 ms 376 KB Output isn't correct
17 Incorrect 2 ms 376 KB Output isn't correct
18 Incorrect 2 ms 376 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1066 ms 504 KB Time limit exceeded
2 Execution timed out 4 ms 504 KB Time limit exceeded (wall clock)
3 Execution timed out 5 ms 632 KB Time limit exceeded (wall clock)
4 Runtime error 343 ms 760 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
6 Runtime error 136 ms 776 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Execution timed out 1087 ms 504 KB Time limit exceeded
8 Runtime error 114 ms 792 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Execution timed out 4 ms 504 KB Time limit exceeded (wall clock)
10 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
11 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
12 Runtime error 238 ms 760 KB Execution killed with signal 11 (could be triggered by violating memory limits)
13 Runtime error 326 ms 632 KB Execution killed with signal 11 (could be triggered by violating memory limits)
14 Runtime error 347 ms 760 KB Execution killed with signal 11 (could be triggered by violating memory limits)
15 Execution timed out 8 ms 632 KB Time limit exceeded (wall clock)
16 Execution timed out 4 ms 760 KB Time limit exceeded (wall clock)
17 Runtime error 343 ms 760 KB Execution killed with signal 11 (could be triggered by violating memory limits)
18 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
2 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
3 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
4 Runtime error 380 ms 888 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
6 Runtime error 913 ms 1020 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
8 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
9 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
10 Runtime error 680 ms 888 KB Execution killed with signal 11 (could be triggered by violating memory limits)
11 Runtime error 495 ms 632 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Runtime error 739 ms 1016 KB Execution killed with signal 11 (could be triggered by violating memory limits)
13 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
14 Runtime error 6 ms 632 KB Execution killed with signal 11 (could be triggered by violating memory limits)
15 Runtime error 622 ms 860 KB Execution killed with signal 11 (could be triggered by violating memory limits)
16 Runtime error 787 ms 1020 KB Execution killed with signal 11 (could be triggered by violating memory limits)
17 Execution timed out 4 ms 636 KB Time limit exceeded (wall clock)
18 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
19 Runtime error 563 ms 888 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
21 Runtime error 14 ms 604 KB Execution killed with signal 11 (could be triggered by violating memory limits)
22 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
23 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
24 Runtime error 128 ms 760 KB Execution killed with signal 11 (could be triggered by violating memory limits)
25 Runtime error 326 ms 860 KB Execution killed with signal 11 (could be triggered by violating memory limits)
26 Runtime error 382 ms 760 KB Execution killed with signal 11 (could be triggered by violating memory limits)
27 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
28 Runtime error 113 ms 760 KB Execution killed with signal 11 (could be triggered by violating memory limits)
29 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
30 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
31 Runtime error 489 ms 888 KB Execution killed with signal 11 (could be triggered by violating memory limits)
32 Runtime error 327 ms 888 KB Execution killed with signal 11 (could be triggered by violating memory limits)
33 Runtime error 140 ms 784 KB Execution killed with signal 11 (could be triggered by violating memory limits)
34 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
35 Runtime error 223 ms 632 KB Execution killed with signal 11 (could be triggered by violating memory limits)
36 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
37 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
38 Runtime error 943 ms 868 KB Execution killed with signal 11 (could be triggered by violating memory limits)
39 Runtime error 255 ms 832 KB Execution killed with signal 11 (could be triggered by violating memory limits)
40 Runtime error 1044 ms 1020 KB Execution killed with signal 11 (could be triggered by violating memory limits)
41 Execution timed out 4 ms 632 KB Time limit exceeded (wall clock)
42 Runtime error 341 ms 644 KB Execution killed with signal 11 (could be triggered by violating memory limits)