Submission #25792

#TimeUsernameProblemLanguageResultExecution timeMemory
25792TAMREF앱 (KOI13_app)C++11
0 / 21
3 ms2096 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll D[10005]; int C[105], M[105],N,T; int main(){ scanf("%d%d",&N,&T); for(int i=0;i<N;i++) scanf("%d",&M[i]); for(int i=0;i<N;i++) scanf("%d",&C[i]); for(int i=0;i<N;i++){ for(int c=0;c+C[i]<=1e4;c++){ if(D[c]) D[c+C[i]]=max(D[c+C[i]],D[c]+M[i]); } D[C[i]]=max(D[C[i]],(ll)M[i]); } for(int c=0;c<=1e4;c++) if(D[c]>=T) return !printf("%d\n",c); }

Compilation message (stderr)

app.cpp: In function 'int main()':
app.cpp:7:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&N,&T);
                        ^
app.cpp:8:43: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(int i=0;i<N;i++) scanf("%d",&M[i]);
                                           ^
app.cpp:9:43: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(int i=0;i<N;i++) scanf("%d",&C[i]);
                                           ^
#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...