제출 #719932

#제출 시각아이디문제언어결과실행 시간메모리
719932Yell0동굴 (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; void exploreCave(int N) { int config[N],perm[N]; ordered_set idx; for(int i=0;i<N;++i) idx.insert(i); for(int i=0;i<N;++i) { bool on=1; for(int x:idx) config[x]=1; if(tryCombination(config)<=i) up=0; for(int x:idx) config[x]=!on; int st=0,sz=(N-i)/2,psz=N-i,sw; while(sz>0) { sw=st; for(int j=st;j<=st+sz;++j) config[idx[j]]=on; if(tryCombination(config)<=i) { st=st+sz; int tsz=sz; sz=(psz-sz)/2; psz=tsz; } else { sz/=2; sw=st; } for(int j=st;j<=st+sz;++j) config[idx[j]]=!on; } perm[sw]=i; config[sw]=on; idx.erase(sw); } answer(perm,config); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:16:8: error: 'tryCombination' was not declared in this scope
   16 |     if(tryCombination(config)<=i) up=0;
      |        ^~~~~~~~~~~~~~
cave.cpp:16:35: error: 'up' was not declared in this scope
   16 |     if(tryCombination(config)<=i) up=0;
      |                                   ^~
cave.cpp:21:40: error: no match for 'operator[]' (operand types are 'int [N]' and '__gnu_pbds::null_type')
   21 |       for(int j=st;j<=st+sz;++j) config[idx[j]]=on;
      |                                        ^
cave.cpp:22:10: error: 'tryCombination' was not declared in this scope
   22 |       if(tryCombination(config)<=i) {
      |          ^~~~~~~~~~~~~~
cave.cpp:31:40: error: no match for 'operator[]' (operand types are 'int [N]' and '__gnu_pbds::null_type')
   31 |       for(int j=st;j<=st+sz;++j) config[idx[j]]=!on;
      |                                        ^
cave.cpp:37:3: error: 'answer' was not declared in this scope
   37 |   answer(perm,config);
      |   ^~~~~~