Submission #140432

#TimeUsernameProblemLanguageResultExecution timeMemory
140432silxikysTreasure (different grader from official contest) (CEOI13_treasure2)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; int N; int ask(int r1, int c1, int r2, int c2) { printf("%d %d %d %d\n",r1,c1,r2,c2); fflush(stdout); int res; cin >> res; return res; } const int maxn = 105; int g[maxn][maxn]; void recurse(int r1, int c1, int r2, int c2) { int r = ask(r1,c1,r2,c2); if (r == (r2-r1+1)*(c2-c1+1)) { //all filled for (int i = r1; i <= r2; i++) { for (int j = c1; j <= c2; j++) { g[i][j] = 1; } } return; } else if (r == 0) { return; } else { if (r1 == r2) { int m = (c1+c2)/2; recurse(r1,c1,r2,m); recurse(r1,m+1,r2,c2); } else { int m = (r1+r2)/2; recurse(r1,c1,m,c2); recurse(m+1,c1,r2,c2); } } } int main() { cin >> N; recurse(1,1,N,N); cout << "END" << endl; for (int i = 1; i <= N; i++) { for (int j = 1; j <= N; j++) { cout << g[i][j]; } cout << '\n'; } }

Compilation message (stderr)

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