제출 #884223

#제출 시각아이디문제언어결과실행 시간메모리
884223kokoue은행 (IZhO14_bank)C++14
0 / 100
1 ms600 KiB
#include<bits/stdc++.h> using namespace std; bool sum[20001]; int n,m; int a[100],b[100]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cin>>n>>m; int summ=0; for(int i=0;i<n;i++) { cin>>a[i]; summ+=a[i]; } for(int i=0;i<m;i++) { cin>>b[i]; } sum[b[0]]=true; sum[0]=true; int maxsum=b[0]; int minsum=b[0]; // for(int i=1;i<m;i++) { // int currmax=0; for(int j=1;j<=summ;j++) { if(sum[j]==true) { // currmax=max(currmax,j+b[i]); sum[j+b[i]]=true; } } // maxsum=max(maxsum,currmax); sum[b[i]]=true; //minsum=min(minsum,b[i]); } // for(int i=0;i<n;i++) { if(!sum[a[i]]) {cout<<"NO\n";return 0;} } cout<<"YES\n"; return 0; }

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

bank.cpp: In function 'int main()':
bank.cpp:23:9: warning: unused variable 'maxsum' [-Wunused-variable]
   23 |     int maxsum=b[0];
      |         ^~~~~~
bank.cpp:24:9: warning: unused variable 'minsum' [-Wunused-variable]
   24 |     int minsum=b[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...