제출 #1027698

#제출 시각아이디문제언어결과실행 시간메모리
1027698vjudge1은행 (IZhO14_bank)C++17
19 / 100
2 ms436 KiB
#include <bits/stdc++.h> using namespace std; bool kiki=0; void baraj(int pari[], int i, int plata, int suma, int m) { if(suma==plata) { kiki=1; return; } if(i==m) return; if(suma+pari[i]<=plata) baraj(pari, i+1, plata, suma+pari[i], m); baraj(pari, i+1, plata, suma, m); } int main() { int n, m; cin>>n>>m; int plata[n]; for(int i=0; i<n; i++) { cin>>plata[i]; } if(n==1) { int pari[m]; for(int i=0; i<m; i++) { cin>>pari[i]; } baraj(pari, 0, plata[0], 0, m); if(kiki) cout<<"YES"; else cout<<"NO"; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...