Submission #9615

# Submission time Handle Problem Language Result Execution time Memory
9615 2014-09-28T07:39:21 Z myungwoo Zu (kriii2_Z) C++14
1 / 4
4 ms 1820 KB
#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
1 Correct 0 ms 1820 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 1820 KB Output isn't correct