제출 #1277950

#제출 시각아이디문제언어결과실행 시간메모리
1277950bnijaamaaBank (IZhO14_bank)C++20
0 / 100
56 ms40848 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define all(x)(x).begin(), (x).end() #define F first #define S second #define nn '\n' #define pb push_back signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); freopen("bank.in", "r", stdin); freopen("bank.out", "w", stdout); int n, m; cin >> n >> m; vector < int > a(n + 1),b(m + 1); for (int i = 0; i < n; ++i) cin >> a[i]; for (int i = 0; i < m; ++i) cin >> b[i]; int cnt = a[0]; vector < bool > dp(cnt + 1, false); dp[0] = true; for (int i = 1; i <= m; ++i) { for (int j = cnt; j >= b[i]; --j) { if (dp[j - b[i]]) dp[j] = true; } } if (dp[cnt]) cout << "YES"; else cout << "NO"; }

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

bank.cpp: In function 'int main()':
bank.cpp:15:13: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |      freopen("bank.in", "r", stdin);
      |      ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
bank.cpp:16:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |     freopen("bank.out", "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...