Submission #5753

#TimeUsernameProblemLanguageResultExecution timeMemory
5753baneling100Treasure (different grader from official contest) (CEOI13_treasure2)C++98
4 / 100
0 ms1224 KiB
#include "treasure.h" int Check[101][101]; void Quad_Search(int ly, int lx, int ry, int rx) { int midy=(ly+ry)/2, midx=(lx+rx)/2; if(ly==ry && lx==rx) Check[ly][lx]=1; else { if(ly<=midy && lx<=midx) { if(countTreasure(ly,lx,midy,midx)) Quad_Search(ly,lx,midy,midx); } if(ly<=midy && midx+1<=rx) { if(countTreasure(ly,midx+1,midy,rx)) Quad_Search(ly,midx+1,midy,rx); } if(midy+1<=ry && lx<=midx) { if(countTreasure(midy+1,lx,ry,midx)) Quad_Search(midy+1,lx,ry,midx); } if(midy+1<=ry && midx+1<=rx) if(countTreasure(midy+1,midx+1,ry,rx)) Quad_Search(midy+1,midx+1,ry,rx); } } void findTreasure(int N) { int i, j; Quad_Search(1,1,N,N); for(i=1 ; i<=N ; i++) for(j=1 ; j<=N ; j++) if(Check[i][j]) Report(i,j); }

Compilation message (stderr)

grader.c: In function 'int main()':
grader.c:63:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         my_assert(strlen(A[i]+1) == N, "each line of the map must contain N zeroes or ones (before loop)");
                                  ^
#Verdict Execution timeMemoryGrader output
Fetching results...