제출 #1098252

#제출 시각아이디문제언어결과실행 시간메모리
1098252vjudge1은행 (IZhO14_bank)C++17
0 / 100
1 ms440 KiB
#include<bits/stdc++.h> using namespace std ; int a[1000], b[1000]; int main(){ int n,m; cin >> n >> m; for(int i=1; i<=n ; i++){ cin >> a[i]; } for(int i=1; i<=m; i++){ cin >> b[i]; } int cnt=0; for(int i=1 ;i<=n; i++){ bool ok=0; for(int j=1; j<=m; j++) { if(a[i]==b[j]){ ok=1; cnt ++ ; break; } } if(ok)continue; for(int j=1; j<=m; j++){ next_permutation(b+1, b+m+1); int sum = 0; bool k=0; for(int h=1;h<=m;h++){ sum+=b[h]; if(sum == a[i]){ cnt++; k=1; for(int f=1; f<=h; f++){ b[f] == 0; } break; } } if(k)break; } } if(cnt == n) cout << "YES"; else { cout << "NO"; } } //SULTAN SKATAL y Minya

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

bank.cpp: In function 'int main()':
bank.cpp:35:12: warning: statement has no effect [-Wunused-value]
   35 |       b[f] == 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...