제출 #851215

#제출 시각아이디문제언어결과실행 시간메모리
851215NamPE은행 (IZhO14_bank)C++17
25 / 100
1046 ms600 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, m; cin >> n >> m; vector<ll> a(n), b(m); for (ll& i : a) { cin >> i; } for (ll& i : b) { cin >> i; } sort(b.begin(), b.end()); do { ll sum = 0; ll cur = 0; for (ll i : b) { sum += i; if (sum == a[cur]) { cur++; sum = 0; } else if (sum > a[cur]) { break; } if (cur == a.size()) { cout << "YES"; return 0; } } } while (next_permutation(b.begin(), b.end())); cout << "NO"; }

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

bank.cpp: In function 'int main()':
bank.cpp:36:21: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |             if (cur == a.size()) {
      |                 ~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...