# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
26319 | 2017-06-29T07:52:39 Z | 김동현(#1101) | Trapezi (COI17_trapezi) | C++14 | 0 ms | 2020 KB |
#include <bits/stdc++.h> using namespace std; int n, c[11][22], bd[11]; char b[11][22]; void f(int x, int y){ if(x > 2 * n){ for(int i = 1; i <= 2 * n; i++){ for(int j = 1; j < bd[i]; j++){ putchar(c[i][j] ? c[i][j] + '0' : '.'); } puts(""); } exit(0); } if(y == bd[x]) f(x + 1, 1); if(b[x][y] == '.') f(x, y + 1); if(y % 2){ if(b[x][y + 1] == '0' && b[x][y + 2] == '0'){ c[x][y] = c[x][y + 1] = c[x][y + 2] = 2 * (x % 2) + 4; b[x][y + 1] = b[x][y + 2] = '.'; f(x, y + 3); b[x][y + 1] = b[x][y + 2] = '0'; } if(b[x][y + 1] == '0' && b[x + 1][y + 1] == '0'){ c[x][y] = c[x][y + 1] = c[x + 1][y + 1] = 2 * (x % 2) + 4; b[x][y + 1] = b[x + 1][y + 1] = '.'; f(x, y + 2); b[x][y + 1] = b[x + 1][y + 1] = '0'; } if(b[x + 1][y] == '0' && b[x + 1][y + 1] == '0'){ c[x][y] = c[x + 1][y] = c[x + 1][y + 1] = 2 * (x % 2) + 3; b[x + 1][y] = b[x + 1][y + 1] = '.'; f(x, y + 1); b[x + 1][y] = b[x + 1][y + 1] = '0'; } if(b[x + 1][y + 1] == '0' && b[x + 1][y + 2] == '0'){ c[x][y] = c[x + 1][y + 1] = c[x + 1][y + 2] = 2 * (x % 2) + 4; b[x + 1][y + 1] = b[x + 1][y + 2] = '.'; f(x, y + 1); b[x + 1][y + 1] = b[x + 1][y + 2] = '0'; } } else{ if(b[x][y + 1] == '0' && b[x][y + 2] == '0'){ c[x][y] = c[x][y + 1] = c[x][y + 2] = 2 * (x % 2) + 2; b[x][y + 1] = b[x][y + 2] = '.'; f(x, y + 3); b[x][y + 1] = b[x][y + 2] = '0'; } if(b[x][y + 1] == '0' && b[x + 1][y + 2] == '0'){ c[x][y] = c[x][y + 1] = c[x + 1][y + 2] = 2 * (x % 2) + 4; b[x][y + 1] = b[x + 1][y + 2] = '.'; f(x, y + 2); b[x][y + 1] = b[x + 1][y + 2] = '0'; } } } int main(){ scanf("%d", &n); for(int i = 1; i <= 2 * n; i++){ scanf("%s", b[i] + 1); for(bd[i] = 1; b[i][bd[i]]; bd[i]++); } f(1, 1); puts("nemoguce"); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2020 KB | Output is correct |
2 | Correct | 0 ms | 2020 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 2020 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 2020 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 2020 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 2020 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |