제출 #370570

#제출 시각아이디문제언어결과실행 시간메모리
370570Fysty동굴 (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> pll; #define rep(i,n) for(int i=0;i<n;i++) #define rep1(i,n) for(int i=1;i<n;i++) #define F first #define S second #define pb push_back int tryCombination(vector<int> S); void answer(vector<int> S,vector<int> D); bool vis[5005]; void exploreCave(int N) { int n=N; vector<int> a(n,0),d(n),s(n); rep(i,n) { bool x=0; if(tryCombination(a)==i) x=1; vector<int> tmp=a,pos; if(x) { rep(i,n) if(!vis[i]) tmp[i]=1; } rep(i,n) if(!vis[i]) pos.pb(i); int l=0,r=pos.size()-1; while(l<r) { int mid=l+r>>1; vector<int> tmp2=tmp; for(int j=l;j<=mid;j++) { if(x) tmp2[pos[j]]=0; else tmp2[pos[j]]=1; } if(tryCombination(tmp2)==i) r=mid; else l=mid+1; } vis[l]=1; s[l]=x; d[l]=i; a[l]=s[l]; } answer(s,d); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:30:22: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   30 |             int mid=l+r>>1;
      |                     ~^~
/tmp/ccYT4E9G.o: In function `exploreCave(int)':
cave.cpp:(.text+0x16a): undefined reference to `tryCombination(std::vector<int, std::allocator<int> >)'
cave.cpp:(.text+0x352): undefined reference to `tryCombination(std::vector<int, std::allocator<int> >)'
cave.cpp:(.text+0x514): undefined reference to `answer(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
/tmp/ccZ8vjoB.o: In function `main':
grader.c:(.text.startup+0xc): undefined reference to `exploreCave'
collect2: error: ld returned 1 exit status