Submission #1278

#TimeUsernameProblemLanguageResultExecution timeMemory
1278tncks0121앱 (KOI13_app)C++98
21 / 21
0 ms1168 KiB
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <memory.h> #include <math.h> #include <assert.h> #include <stack> #include <queue> #include <map> #include <set> #include <algorithm> #include <string> #include <functional> #include <vector> #include <deque> #include <utility> #include <bitset> #include <limits.h> using namespace std; typedef long long ll; typedef long double llf; typedef unsigned long long llu; const int INF = 987654321; const ll LINF = (ll)1e15; const int N_ = 105; const int K_ = 10000005; const int C_ = 100 * N_; int N, K, M[N_], C[N_]; ll Table[C_]; int main() { int i, j; scanf("%d%d", &N, &K); for(i = 1; i <= N; i++) scanf("%d", M+i); for(i = 1; i <= N; i++) scanf("%d", C+i); for(i = 1; i <= N; i++) { for(j = 10000; j >= C[i]; j--) Table[j] = max(Table[j], Table[j - C[i]] + M[i]); } for(j = 0; j <= 10000; j++) { if(Table[j] >= K) return 0 & printf("%d\n", j); } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...