Submission #37605

#TimeUsernameProblemLanguageResultExecution timeMemory
3760514kg앱 (KOI13_app)C++11
3.15 / 21
539 ms40176 KiB
#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 - in[i].first; j >= 0; j--) d[j + in[i].first] = min2(d[j + in[i].first], d[j] + in[i].second); printf("%d", d[m]); }

Compilation message (stderr)

app.cpp: In function 'int main()':
app.cpp:11:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d", &n, &m);
                        ^
app.cpp:13:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &in[i].first);
                            ^
app.cpp:16:57: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for (int i = 1; i <= n; i++) scanf("%d", &in[i].second);
                                                         ^
#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...