Submission #1143225

#TimeUsernameProblemLanguageResultExecution timeMemory
1143225victor_cWalk (POI13_spa)C++20
Compilation error
0 ms0 KiB
#include <iostream> #include <algorithm> #include <vector> using namespace std; char x[1<<24], w; void red(int &x) { x=0; for(int i=0;i<n;i++) { cin>>w; x=x*2+w-'0'; } } void df(int v) { x[v]=2; for(int i=0;i<n;i++) { if(x[v^(1<<i)]==0) df(v^(1<<i)); } } int main() { int n, m, a, b; cin>>n>>m; red(a); red(b); for(j=0; j<m; j++) { red(k); x[k]=1; } if(a==b) { cout<<"TAK"; return 0; } df(a); if(x[b]==2) cout<<"TAK"; else cout<<"NIE"; } return 0;

Compilation message (stderr)

spa.cpp: In function 'void red(int&)':
spa.cpp:11:19: error: 'n' was not declared in this scope
   11 |     for(int i=0;i<n;i++)
      |                   ^
spa.cpp: In function 'void df(int)':
spa.cpp:20:19: error: 'n' was not declared in this scope
   20 |     for(int i=0;i<n;i++)
      |                   ^
spa.cpp: In function 'int main()':
spa.cpp:32:9: error: 'j' was not declared in this scope
   32 |     for(j=0; j<m; j++)
      |         ^
spa.cpp:34:13: error: 'k' was not declared in this scope
   34 |         red(k);
      |             ^
spa.cpp: At global scope:
spa.cpp:47:1: error: expected unqualified-id before 'return'
   47 | return 0;
      | ^~~~~~