#include <stdio.h>
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
int n, m;
vector <string> a;
vector<string> F(int i, int j) {
vector<string> s;
for (int k = i; k <= i + 4; k++) s.push_back(a[k].substr(j, 5));
return s;
}
map<string, string> d;
int main() {
d["#####""..#..""#...#""#####""#####"] = "a";
d["#####""#...#""#.#.#""....#""#####"] = "b";
d["#####""###..""###.#""###..""#####"] = "c";
d["#####""#####""#####""..###""#.###"] = "d";
d["#####""..###""#.###""#....""#####"] = "e";
d["#####""#.#.#""....#""#.#.#""#####"] = "f";
d["###.#""##..#""##.##""##..#""###.#"] = "g";
d["#####""#...#""#.#.#""#...#""###.#"] = "h";
d["#.#.#""#...#""#####""#####""#####"] = "i";
d["#####""#####""#####""###..""###.#"] = "j";
d["###.#""###.#""###.#""#...#""#.###"] = "kq";
d["#####""#...#""##.##""#...#""##.##"] = "l";
d["#####""#####""#...#""..#..""#####"] = "m";
d["#####""#....""#.#.#""#...#""#####"] = "n";
d["#####""..###""#.###""..###""#####"] = "o";
d["###.#""###..""#####""#####""#####"] = "p";
d["#####""....#""###.#""###..""#####"] = "z";
d["#####""#.#.#""#....""#.#.#""#####"] = "r";
d["#.###""#..##""##.##""#..##""#.###"] = "s";
d["#.###""#...#""#.#.#""#...#""#####"] = "t";
d["#####""#####""#####""#...#""#.#.#"] = "uv";
d["#.###""..###""#####""#####""#####"] = "w";
d["###.#""#...#""#.###""#.###""#.###"] = "x";
d["##.##""#...#""##.##""#...#""#####"] = "y";
d["#####""#...#""#...#""#...#""#####"] = "0";
d["#####""#.#.#""#.#.#""#...#""#####"] = "1";
d["#####""#...#""#.###""#...#""#####"] = "2";
d["#####""#...#""#.#.#""#.#.#""#####"] = "3";
d["#####""#.#.#""#.###""#...#""#####"] = "3";
d["#####""#...#""###.#""#...#""#####"] = "4";
d["#####""#.#.#""#.#.#""#.#.#""#####"] = "4";
d["#####""#...#""#.###""#.#.#""#####"] = "5";
d["#####""#.#.#""###.#""#...#""#####"] = "5";
d["#####""#...#""#####""#...#""#####"] = "6";
d["#####""#.#.#""#.###""#.#.#""#####"] = "6";
d["#####""#...#""###.#""#.#.#""#####"] = "7";
d["#####""#.#.#""#####""#...#""#####"] = "7";
d["#####""#.#.#""###.#""#.#.#""#####"] = "8";
d["#####""#...#""#####""#.#.#""#####"] = "9";
d["#####""#.#.#""#####""#.#.#""#####"] = "10";
d["....."".....""....."".....""....."] = "_";
scanf("%d%d", &n, &m);
a.resize(6 * n - 1);
for (int i = 0; i < 6 * n - 1; i++) cin >> a[i];
for (int j = m - 1; j >= 0; j--) {
for (int i = 0; i < n; i++) {
string s = "";
vector<string> e = F(i * 6, j * 6);
for (auto &j : e) s += j;
printf("%s", d[s].c_str());
}
puts("");
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
1864 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1864 KB |
Output is correct |