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 <iostream>
#include <vector>
#include <string>
#include <map>
using namespace std;
#define c(y,x) (A[y][x]=='.')
typedef vector<string> pat;
int N, M, R, C;
string A[444];
map <pat, string> to;
int main()
{
ios_base::sync_with_stdio(false);
int i, j, k, l;
cin >> N >> M;
R = N*6-1, C = M*6-1;
for (i=0;i<R;i++) cin >> A[i];
to[pat{".....", ".....", ".....", ".....", "....."}] = "_";
to[pat{"#####", "#.#.#", "#.###", "#...#", "#####"}] = "3";
to[pat{"#####", "###..", "###.#", "###..", "#####"}] = "c";
to[pat{"#####", "#####", "#####", "..###", "#.###"}] = "d";
to[pat{"#####", "..#..", "#...#", "#####", "#####"}] = "a";
to[pat{"#####", "#...#", "#.#.#", "....#", "#####"}] = "b";
to[pat{"#####", "#####", "#####", "#...#", "#.#.#"}] = "u";
to[pat{"#####", "#...#", "#.#.#", "#.#.#", "#####"}] = "v3";
to[pat{"#####", "#.#.#", "#####", "#.#.#", "#####"}] = "10";
to[pat{"###.#", "###.#", "###.#", "#...#", "#.###"}] = "kq";
//to[pat{"#####", "#####", "#####", "#####", "#####"}] = "d";
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;
pat p;
for (k=sy;k<ey;k++) p.push_back(A[k].substr(sx, 5));
if (to.find(p) != to.end()){
cout << to[p];
}
else cout << "z";
}
cout << endl;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |