Submission #9682

#TimeUsernameProblemLanguageResultExecution timeMemory
9682myungwooZu (kriii2_Z)C++14
1 / 4
4 ms1820 KiB
#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{"#####", "#.#.#", "#####", "#.#.#", "#####"}] = "1"; to[pat{"###.#", "###.#", "###.#", "#...#", "#.###"}] = "0kq"; //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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...