제출 #223144

#제출 시각아이디문제언어결과실행 시간메모리
223144aggu_01000101동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "cave.h" #define mid(l, u) ((l+u)/2) #define test(a) tryCombination(a); #define lchild(i) (i*2 + 1) #define rchild(i) (i*2 + 2) using namespace std; int N; /*int tryCombination(int a[]){ cout<<"COMBINATION"<<endl; for(int i = 0;i<N;i++) cout<<a[i]<<" "; cout<<endl; int tr; cin>>tr; return tr; } void answer(int s[], int d[]){ cout<<"ANSWER"<<endl; for(int i = 0;i<N;i++) cout<<s[i]<<" "; cout<<endl; for(int i = 0;i<N;i++) cout<<d[i]<<" "; cout<<endl; }*/ void exploreCave(int n){ N = n; int currdoor = 0; bool change[n]; for(int i = 0;i<n;i++) change[i] = true; int q[n]; int r; int ans[n]; while(currdoor<n){ for(int i = 0;i<n;i++){ if(change[i]) q[i] = 1; }// r = test(q); int req = (r==currdoor); int l = 0; int u = n-1; while(l<u){ int m = mid(l, u); for(int i = l;i<=m;i++){ if(change[i]) q[i] = req; } for(int i = m+1;i<=u;i++){ if(change[i]) q[i] = req^1; } r = test(q); if(r==currdoor){ u = m; } else{ l = m+1; } } change[l] = false; q[l] = (req^1); ans[l] = currdoor; currdoor++; } answer(q, ans); } int main(){ exploreCave(4); }

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

/tmp/ccZVgRc0.o: In function `main':
cave.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cc2Uqx0g.o:grader.c:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status