제출 #833707

#제출 시각아이디문제언어결과실행 시간메모리
833707Toster_은행 (IZhO14_bank)C++14
19 / 100
4 ms212 KiB
#include <bits/stdc++.h> using namespace std; bool d(vector<int>& n, int t, int in, int sum) { if (in == n.size()) { return sum == t; }if (d(n, t, in + 1, sum + n[in])) { return true; }if (d(n, t, in + 1, sum)) { return true; } return false; } bool d(vector<int>& n, int t) { return d(n, t, 0, 0); } int main() { int r,s; cin>>r>>s; vector<int> n; int t; cin>>t; for (int i=0; i<s; i++) { int q; cin>>q; n.push_back(q); } if (d(n, t)) { cout << "YES"; } else { cout << "NO"; } return 0; }

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

bank.cpp: In function 'bool d(std::vector<int>&, int, int, int)':
bank.cpp:4:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    4 |     if (in == n.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...