제출 #723413

#제출 시각아이디문제언어결과실행 시간메모리
723413LittleFlowers__드문 곤충 (IOI22_insects)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; int hmt() {int x=0;int c=getchar(),n=0;for(;!isdigit(c);c=getchar()) n=(c=='-');for(;isdigit(c);c=getchar()) x=x*10+c-'0';if(n) x=-x;return x;} #define in hmt() #define ins ({string x;char c=getchar();for(;c==' '||c=='\n';c=getchar());for(;c!=' '&&c!='\n';c=getchar()) x+=c;x;}) #define forinc(i,a,b) for(int i=a,_b=b;i<=_b;++i) #define fordec(i,a,b) for(int i=a;i>=b;--i) #define forb(i,BS) for(int i=BS._Find_first();i< BS.size();i = BS._Find_next(i)) #define timer 1.0*clock()/CLOCKS_PER_SEC #define forv(a,b) for(auto &a:b) #define pb push_back #define pii pair<int,int> #define fi first #define se second #define all(a) a.begin(),a.end() #define reset(f,x) memset(f,x,sizeof(f)) #define bit(x,i) ((x>>(i-1))&1) #define onbit(x,i) (x|(1<<(i-1))) #define offbit(x,i) (x&~(1<<(i-1))) int n,dd[2010]; vector<int> a,b; /*void move_inside(int i) {} void move_outside(int i) {} int press_button() {}*/ int min_cardinality(int N) { n=N; forinc(i,0,n-1) a.pb(i); random_shuffle(all(a)); while(1) { reset(dd,0); int sz=a.size(); int i=a[rand()%sz]; move_inside(i); dd[i]=1; int mx=1; forv(j,a) if(!dd[j]) { move_inside(j); if(press_button()>mx) { ++mx; dd[j]=1; } else move_outside(j); } if(mx==sz||mx==1) return mx; forv(j,a) if(dd[j]) move_outside(j); random_shuffle(all(a)); if(sz%mx) --mx; forv(j,a) if(!dd[j]) { move_inside(j); int press=press_button(); if(press>mx) { move_outside(j); } else b.pb(j); } swap(a,b); b.clear(); } } /*int main() { }*/

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

insects.cpp: In function 'int min_cardinality(int)':
insects.cpp:37:9: error: 'move_inside' was not declared in this scope
   37 |         move_inside(i);
      |         ^~~~~~~~~~~
insects.cpp:43:16: error: 'press_button' was not declared in this scope
   43 |             if(press_button()>mx) {
      |                ^~~~~~~~~~~~
insects.cpp:46:20: error: 'move_outside' was not declared in this scope
   46 |             } else move_outside(j);
      |                    ^~~~~~~~~~~~
insects.cpp:51:29: error: 'move_outside' was not declared in this scope
   51 |         forv(j,a) if(dd[j]) move_outside(j);
      |                             ^~~~~~~~~~~~
insects.cpp:57:23: error: 'press_button' was not declared in this scope
   57 |             int press=press_button();
      |                       ^~~~~~~~~~~~
insects.cpp:59:17: error: 'move_outside' was not declared in this scope
   59 |                 move_outside(j);
      |                 ^~~~~~~~~~~~