제출 #277104

#제출 시각아이디문제언어결과실행 시간메모리
277104Marlov보물 찾기 (CEOI13_treasure2)C++14
컴파일 에러
0 ms0 KiB
/* Code by @marlov */ #include <iostream> #include <fstream> #include <string> #include <sstream> #include <vector> #include <string> #include <cmath> #include <algorithm> #include <iomanip> #include <utility> #include <set> #include <unordered_set> #include <map> #include <unordered_map> #include <stack> #include <queue> #include <iterator> using namespace std; typedef long long ll; typedef pair<int,int> pi; #define maxN 105 int N; int grid[maxN][maxN]; void bs(int x1,int y1,int x2,int y2){ if(x1==x2||y1==y2) return; cout<<x1+1<<" "<<y1+1<<" "<<x2<<" "<<y2<<endl; int num=0; cin>>num; if(num==0) return; if(x1+1==x2&&y1+1==y2){ grid[x1][y1]=1; return; } bs(x1,y1,(x1+x2)/2,(y1+y2)/2); bs((x1+x2)/2,y1,x2,(y1+y2)/2); bs(x1,(y1+y2)/2,(x1+x2)/2,y2); bs((x1+x2)/2,(y1+y2)/2,x2,y2); } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin>>N; bs(0,0,N,N); cout<<"END"<<endl; for(int i=0;i<N;i++){ for(int j=0;j<N;j++){ cout<<grid[j][i]<<" "; } cout<<endl; } return 0; } /* stuff you should look for * int overflow, array bounds * special cases (n=1,n=0?) * do smth instead of nothing and stay organized */

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

/tmp/cc6pmDWP.o: In function `main':
treasure.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cch6Onpa.o:grader.c:(.text.startup+0x0): first defined here
/tmp/cch6Onpa.o: In function `main':
grader.c:(.text.startup+0x10e): undefined reference to `findTreasure(int)'
collect2: error: ld returned 1 exit status