Submission #9570

#TimeUsernameProblemLanguageResultExecution timeMemory
9570myungwooZu (kriii2_Z)C++14
1 / 4
0 ms1280 KiB
#include <stdio.h> #define c(y,x) (A[y][x]=='.') int N, M, R, C; char A[444][444]; int main() { int i, j, k, l; scanf("%d%d", &N, &M); R = N*6-1, C = M*6-1; for (i=0;i<R;i++) scanf("%s", A[i]); for (i=0;i<M;i++){ for (j=0;j<N;j++){ int sy = j*6, ey = j*6+5; int sx = (M-i-1)*6, ex = (M-i-1)*6+5; int cnt = 0; for (k=sy;k<ey;k++) for (l=sx;l<ex;l++) if (A[k][l] == '.') cnt++; char c = 'z'; if (cnt == 7 && c(sy+1,sx) && c(sy+1,sx+1) && c(sy+2,sx+1) && c(sy+2,sx+2) && c(sy+2,sx+3)) c = 'a'; if (cnt == 9 && c(sy+3,sx) && c(sy+3,sx+1)) c = 'b'; if (cnt == 5 && c(sy+1,sx+4) && c(sy+1,sx+3) && c(sy+2,sx+3) && c(sy+3,sx+3) && c(sy+3,sx+4)) c = 'c'; if (cnt == 3) c = 'd'; if (cnt == 25) c = '_'; printf("%c", c); } puts(""); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...