제출 #1224132

#제출 시각아이디문제언어결과실행 시간메모리
1224132sleepntsheepKitchen (BOI19_kitchen)C++17
0 / 100
3 ms328 KiB
#include <stdio.h> #define N 405 int x, n, m, k, a[N], b[N], dp[99999]; int main() { scanf("%d%d%d", &n, &m, &k); for (int i = 0; i < n; ++i) scanf("%d", &a[i]), x += a[i]; for (int i = 0; i < m; ++i) scanf("%d", &b[i]); dp[0] = 1; for (int i = 0; i < m; ++i) { for (int j = 25000; j >= b[i]; --j) { dp[j] |= dp[j - b[i]]; } } for (int h = 0; x + h < 25000; ++h) { if (dp[x + h]) { printf("%d\n", h); return 0; } } puts("Impossible"); return 0; }

컴파일 시 표준 에러 (stderr) 메시지

kitchen.cpp: In function 'int main()':
kitchen.cpp:9:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |         scanf("%d%d%d", &n, &m, &k);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~
kitchen.cpp:11:22: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |                 scanf("%d", &a[i]), x += a[i];
      |                 ~~~~~^~~~~~~~~~~~~
kitchen.cpp:14:22: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |                 scanf("%d", &b[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...