Submission #4578

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
45782013-11-04 14:27:21KH_Lee0415토마토 (3차원) (KOI13_tomato3D)C++98
20 / 20
156 ms22300 KiB
#include<stdio.h>
int R;
int box[101][101][101];
int xx[6]={0,0,0,0,1,-1};
int yy[6]={0,0,1,-1,0,0};
int zz[6]={1,-1,0,0,0,0};
int f, r;
int X, Y, Z;
struct data{
int x, y, z, l;
void inq(int zz, int yy, int xx, int ll){
if(xx<1 || yy<1 || zz<1 || xx>X || yy>Y || zz>Z) return;
if(box[zz][yy][xx]) return;
x=xx, y=yy, z=zz, l=ll, r++;
box[z][y][x]=1;
R--;
}
}q[1100000];
void bfs(){
while(f<r){
for(int i=0; i<6; i++) q[r].inq(q[f].z+zz[i], q[f].y+yy[i], q[f].x+xx[i], q[f].l+1);
f++;
}
}
int main(){
int i, j, k;
scanf("%d %d %d", &X, &Y, &Z);
for(i=1; i<=Z; i++) for(j=1; j<=Y; j++) for(k=1; k<=X; k++) {
scanf("%d", &box[i][j][k]);
if(!box[i][j][k]) R++;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...