Submission #90080

#TimeUsernameProblemLanguageResultExecution timeMemory
90080Rashidov_AnisBank (IZhO14_bank)C++14
Compilation error
0 ms0 KiB
#include<stdio.h> #include<stdlib.h> int a[21],b[21],n,m; void dfs(int x,int sum,int state,int k,int num) { int i; if(x>n) { cout << "YES"; exit(0); } if(sum==0) { dfs(x+1,a[x+1],state,0,num); return; } for(i=k;i<m;i++) { if(m-num-1<n-x) break; if((state>>i)&1 || sum<b[i]) continue; dfs(x,sum-b[i],state|(1<<i),i+1,num+1); } } int main() { int i; cin >> n >> m; for(i=1;i<=n;i++) cin >> a[i]; for(i=1;i<=m;i++) cin >> b[i]; dfs(1,a[1],0,1,0); cout << "NO"; return 0; }

Compilation message (stderr)

bank.cpp: In function 'void dfs(int, int, int, int, int)':
bank.cpp:9:9: error: 'cout' was not declared in this scope
         cout << "YES";
         ^~~~
bank.cpp: In function 'int main()':
bank.cpp:27:5: error: 'cin' was not declared in this scope
     cin >> n >> m;
     ^~~
bank.cpp:27:5: note: suggested alternative: 'main'
     cin >> n >> m;
     ^~~
     main
bank.cpp:31:5: error: 'cout' was not declared in this scope
     cout << "NO";
     ^~~~