Submission #4531

#TimeUsernameProblemLanguageResultExecution timeMemory
4531kriiiTreasure (different grader from official contest) (CEOI13_treasure2)C++98
0 / 100
76 ms262144 KiB
#include "treasure.h" int R[105][105]; void go(int sx, int sy, int ex, int ey, int count) { if (count == 0) return; if ((ex - sx + 1) * (ey - sy + 1) == count){ int i,j; for (i=sx;i<=ex;i++) for (j=sy;j<=ey;j++) R[i][j] = 1; return; } int m,c; if (ex - sx >= ey - sy){ m = (ex + sx) / 2; c = countTreasure(sx,sy,m,ey); go(sx,sy,m,ey,c); go(m+1,sy,ex,ey,count-c); } else{ m = (ey + sy) / 2; c = countTreasure(sx,sy,ex,m); go(sx,sy,ex,m+1,c); go(sx,m+1,ex,ey,count-c); } } void findTreasure (int N) { int i,j; for (i=1;i<=N;i++) for (j=1;j<=N;j++) R[i][j] = 0; go(1,1,N,N,countTreasure(1,1,N,N)); for (i=1;i<=N;i++) for (j=1;j<=N;j++) if(R[i][j] == 1) 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...