# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
37606 | 2017-12-26T10:49:08 Z | 14kg | 앱 (KOI13_app) | C++11 | 723 ms | 40176 KB |
#include <stdio.h> #include <algorithm> #define INF 999999999 #define min2(x,y) (x<y?x:y) using namespace std; int n, m, d[10000001]; pair<int, int> in[101]; int main() { scanf("%d %d", &n, &m); for (int i = 1; i <= n; i++) { scanf("%d", &in[i].first); in[i].first = min2(in[i].first, m); } for (int i = 1; i <= n; i++) scanf("%d", &in[i].second); for (int i = 1; i <= m; i++) d[i] = INF; for (int i = 1; i <= n; i++) for (int j = m; j >= 0; j--) d[min2(m,j + in[i].first)] = min2(d[min2(m,j + in[i].first)], d[j] + in[i].second); printf("%d", d[m]); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 40176 KB | Output is correct |
2 | Correct | 0 ms | 40176 KB | Output is correct |
3 | Correct | 0 ms | 40176 KB | Output is correct |
4 | Correct | 0 ms | 40176 KB | Output is correct |
5 | Correct | 0 ms | 40176 KB | Output is correct |
6 | Correct | 0 ms | 40176 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 40176 KB | Output is correct |
2 | Correct | 0 ms | 40176 KB | Output is correct |
3 | Correct | 0 ms | 40176 KB | Output is correct |
4 | Correct | 0 ms | 40176 KB | Output is correct |
5 | Correct | 0 ms | 40176 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 40176 KB | Output is correct |
2 | Correct | 0 ms | 40176 KB | Output is correct |
3 | Correct | 9 ms | 40176 KB | Output is correct |
4 | Correct | 29 ms | 40176 KB | Output is correct |
5 | Correct | 0 ms | 40176 KB | Output is correct |
6 | Correct | 23 ms | 40176 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 40176 KB | Output is correct |
2 | Correct | 23 ms | 40176 KB | Output is correct |
3 | Correct | 13 ms | 40176 KB | Output is correct |
4 | Correct | 36 ms | 40176 KB | Output is correct |
5 | Correct | 23 ms | 40176 KB | Output is correct |
6 | Correct | 0 ms | 40176 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 376 ms | 40176 KB | Output is correct |
2 | Correct | 596 ms | 40176 KB | Output is correct |
3 | Correct | 723 ms | 40176 KB | Output is correct |
4 | Correct | 473 ms | 40176 KB | Output is correct |
5 | Correct | 93 ms | 40176 KB | Output is correct |
6 | Correct | 33 ms | 40176 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 649 ms | 40176 KB | Output is correct |
2 | Correct | 139 ms | 40176 KB | Output is correct |
3 | Correct | 6 ms | 40176 KB | Output is correct |
4 | Correct | 466 ms | 40176 KB | Output is correct |
5 | Correct | 36 ms | 40176 KB | Output is correct |
6 | Correct | 473 ms | 40176 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 159 ms | 40176 KB | Output is correct |
2 | Correct | 329 ms | 40176 KB | Output is correct |
3 | Correct | 686 ms | 40176 KB | Output is correct |
4 | Correct | 489 ms | 40176 KB | Output is correct |