# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
5753 | baneling100 | Treasure (different grader from official contest) (CEOI13_treasure2) | C++98 | 0 ms | 1224 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |