제출 #1168067

#제출 시각아이디문제언어결과실행 시간메모리
1168067Faisal_Saqib새로운 문제 (POI13_spa)C++17
컴파일 에러
0 ms0 KiB
#include <iostream> #include <map> #include <queue> using namespace std; #define ll long long int n,k; char c; ll asp=0; // 10000000040 bitset<20000000040> 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); ll op=0; while(pq.size()) { ll x=pq.front(); pq.pop(); op++; if(x==ed) { cout<<"TAK"<<endl; return 0; } if(op*n >= 1e9) { break; } 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; }

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

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