Submission #1168059

#TimeUsernameProblemLanguageResultExecution timeMemory
1168059Faisal_SaqibWalk (POI13_spa)C++17
Compilation error
0 ms0 KiB
#include <iostream> #include <map> #include <queue> using namespace std; #define ll long long int n,k; char c; ll asp=0; bitset<1000069> banned; ll read() { asp=0; for(int i=0;i<n;i++) { cin>>c; asp<<=1; asp+=c-'0'; } return asp; } ll gcost(ll x,ll y) { return __builtin_popcountll(x^y); } int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>n>>k; ll st=read(),ed=read(); for(int i=0;i<k;i++) { banned[read()]=1; } queue<ll>pq; banned[st]=1; pq.push(st); while(pq.size()) { ll x=pq.front(); pq.pop(); if(x==ed) { cout<<"TAK"<<endl; return 0; } ll pw=1; for(int bi=0;bi<n;bi++) { ll y=x^pw; if(!banned[y]) { banned[y]=1; pq.push(y); } pw<<=1; } } cout<<"NIE"<<endl; return 0; }

Compilation message (stderr)

spa.cpp:9:1: error: 'bitset' does not name a type
    9 | bitset<1000069> banned;
      | ^~~~~~
spa.cpp: In function 'int main()':
spa.cpp:34:9: error: 'banned' was not declared in this scope
   34 |         banned[read()]=1;
      |         ^~~~~~
spa.cpp:37:5: error: 'banned' was not declared in this scope
   37 |     banned[st]=1;
      |     ^~~~~~