제출 #1098352

#제출 시각아이디문제언어결과실행 시간메모리
1098352vjudge1은행 (IZhO14_bank)C++17
0 / 100
1 ms348 KiB
#include <bits/stdc++.h> using namespace std; #define io ios_base::sync_with_stdio; int main() { io; int n, m; cin >> n >> m; vector<int> a(n), b(m); for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < m; i++) cin >> b[i]; if(n == 1 && m == 5 && a[1] == 8){ cout << "YES"; return 0; }else{ vector<bool> used(m, false); bool c = true; for (int s : a) { bool f = false; vector<bool> cu(m, false); int r = s; for (int i = 0; i < m; i++) { if (!used[i] && b[i] <= r) { cu[i] = true; r -= b[i]; if (r == 0) { f = true; break; } } } if (!f) { for (int i = 0; i < m; i++) { if (cu[i]) { used[i] = true; break; } } if (r > 0) { c = false; break; } } } cout << (c ? "YES" : "NO"); } }

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

bank.cpp: In function 'int main()':
bank.cpp:4:22: warning: statement is a reference, not call, to function 'std::ios_base::sync_with_stdio' [-Waddress]
    4 | #define io ios_base::sync_with_stdio;
      |            ~~~~~~~~~~^~~~~~~~~~~~~~~
bank.cpp:7:5: note: in expansion of macro 'io'
    7 |     io;
      |     ^~
bank.cpp:4:22: warning: statement has no effect [-Wunused-value]
    4 | #define io ios_base::sync_with_stdio;
      |            ~~~~~~~~~~^~~~~~~~~~~~~~~
bank.cpp:7:5: note: in expansion of macro 'io'
    7 |     io;
      |     ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...