답안 #9633

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
9633 2014-09-28T07:45:45 Z corea Zu (kriii2_Z) C++14
4 / 4
8 ms 1820 KB
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>

using namespace std;

int main() {
	map<string, string > M;

M[ "#####"
    "..#.."
    "#...#"
    "#####"
    "#####" ] = "a";

M[ "#####"
    "#...#"
    "#.#.#"
    "....#"
    "#####" ] = "b";

M[ "#####"
    "###.."
    "###.#"
    "###.."
    "#####" ] = "c";

M[ "#####"
    "#####"
    "#####"
    "..###"
    "#.###" ] = "d";

M[ "#####"
    "..###"
    "#.###"
    "#...."
    "#####" ] = "e";

M[ "#####"
    "#.#.#"
    "....#"
    "#.#.#"
    "#####" ] = "f";

M[ "###.#"
    "##..#"
    "##.##"
    "##..#"
    "###.#" ] = "g";

M[ "#####"
    "#...#"
    "#.#.#"
    "#...#"
    "###.#" ] = "h";

M[ "#.#.#"
    "#...#"
    "#####"
    "#####"
    "#####" ] = "i";

M[ "#####"
    "#####"
    "#####"
    "###.."
    "###.#" ] = "j";

M[ "###.#"
    "###.#"
    "###.#"
    "#...#"
    "#.###" ] = "kq";

M[ "#####"
    "#...#"
    "##.##"
    "#...#"
    "##.##" ] = "l";

M[ "#####"
    "#####"
    "#...#"
    "..#.."
    "#####" ] = "m";

M[ "#####"
    "#...."
    "#.#.#"
    "#...#"
    "#####" ] = "n";

M[ "#####"
    "..###"
    "#.###"
    "..###"
    "#####" ] = "o";

M[ "###.#"
    "###.."
    "#####"
    "#####"
    "#####" ] = "p";

M[ "#####"
    "....#"
    "###.#"
    "###.."
    "#####" ] = "z";

M[ "#####"
    "#.#.#"
    "#...."
    "#.#.#"
    "#####" ] = "r";

M[ "#.###"
    "#..##"
    "##.##"
    "#..##"
    "#.###" ] = "s";

M[ "#.###"
    "#...#"
    "#.#.#"
    "#...#"
    "#####" ] = "t";

M[ "#####"
    "#####"
    "#####"
    "#...#"
    "#.#.#" ] = "uv";

M[ "#.###"
    "..###"
    "#####"
    "#####"
    "#####" ] = "w";

M[ "###.#"
    "#...#"
    "#.###"
    "#.###"
    "#.###" ] = "x";

M[ "##.##"
    "#...#"
    "##.##"
    "#...#"
    "#####" ] = "y";

M[ "#####"
    "#...#"
    "#...#"
    "#...#"
    "#####" ] = "0";

M[ "#####"
    "#.#.#"
    "#.#.#"
    "#...#"
    "#####" ] = "1";

M[ "#####"
    "#...#"
    "#.###"
    "#...#"
    "#####" ] = "2";

M[ "#####"
    "#...#"
    "#.#.#"
    "#.#.#"
    "#####" ] = "3";

M[ "#####"
    "#.#.#"
    "#.###"
    "#...#"
    "#####" ] = "3";

M[ "#####"
    "#...#"
    "###.#"
    "#...#"
    "#####" ] = "4";

M[ "#####"
    "#.#.#"
    "#.#.#"
    "#.#.#"
    "#####" ] = "4";

M[ "#####"
    "#...#"
    "#.###"
    "#.#.#"
    "#####" ] = "5";

M[ "#####"
    "#.#.#"
    "###.#"
    "#...#"
    "#####" ] = "5";

M[ "#####"
    "#...#"
    "#####"
    "#...#"
    "#####" ] = "6";

M[ "#####"
    "#.#.#"
    "#.###"
    "#.#.#"
    "#####" ] = "6";
M[ "#####"
    "#...#"
    "###.#"
    "#.#.#"
    "#####" ] = "7";
M[ "#####"
    "#.#.#"
    "#####"
    "#...#"
    "#####" ] = "7";
M[ "#####"
    "#.#.#"
    "###.#"
    "#.#.#"
    "#####" ] = "8";
M[ "#####"
    "#...#"
    "#####"
    "#.#.#"
    "#####" ] = "9";
M[ "#####"
    "#.#.#"
    "#####"
    "#.#.#"
    "#####" ] = "10";

M[ "....."
    "....."
    "....."
    "....."
    "....." ] = "_";

	int n, m;
	cin >> n >> m;
	vector<string> a(6 * n - 1);

	for(int i=0; i<6*n - 1; ++i) {
		cin >> a[i];
	}


	 auto extract = [&](int i, int j) {
		 vector<string> s;
		 for(int k=i; k<i+5; ++k) {
			 s.push_back( a[k].substr(j, 5) );
		 }
		 return s;
	 };

	for(int j = m - 1; j >= 0; -- j) {
		for(int i = 0; i < n; ++ i) {
			vector<string> e = extract(i * 6, j * 6);
			string s = "";
			for(auto &j : e) s += j;

//			for(string &z : e) cout << z << endl; cout << endl;
			cout << M[s];
		}
		cout << endl;
	}

	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 1820 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 1820 KB Output is correct