답안 #9625

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
9625 2014-09-28T07:43:39 Z corea Zu (kriii2_Z) C++14
컴파일 오류
0 ms 0 KB
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>

using namespace std;

int main() {
	map<vector<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);

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

	return 0;
}

Compilation message

Z.cpp: In function 'int main()':
Z.cpp:13:4: error: expected primary-expression before '{' token
Z.cpp:13:4: error: expected ']' before '{' token
Z.cpp:13:4: error: expected ';' before '{' token
Z.cpp:17:14: error: expected primary-expression before ']' token
Z.cpp:17:14: error: expected ';' before ']' token
Z.cpp:19:4: error: expected primary-expression before '{' token
Z.cpp:19:4: error: expected ']' before '{' token
Z.cpp:19:4: error: expected ';' before '{' token
Z.cpp:23:14: error: expected primary-expression before ']' token
Z.cpp:23:14: error: expected ';' before ']' token
Z.cpp:25:4: error: expected primary-expression before '{' token
Z.cpp:25:4: error: expected ']' before '{' token
Z.cpp:25:4: error: expected ';' before '{' token
Z.cpp:29:14: error: expected primary-expression before ']' token
Z.cpp:29:14: error: expected ';' before ']' token
Z.cpp:31:4: error: expected primary-expression before '{' token
Z.cpp:31:4: error: expected ']' before '{' token
Z.cpp:31:4: error: expected ';' before '{' token
Z.cpp:35:14: error: expected primary-expression before ']' token
Z.cpp:35:14: error: expected ';' before ']' token
Z.cpp:37:4: error: expected primary-expression before '{' token
Z.cpp:37:4: error: expected ']' before '{' token
Z.cpp:37:4: error: expected ';' before '{' token
Z.cpp:41:14: error: expected primary-expression before ']' token
Z.cpp:41:14: error: expected ';' before ']' token
Z.cpp:43:4: error: expected primary-expression before '{' token
Z.cpp:43:4: error: expected ']' before '{' token
Z.cpp:43:4: error: expected ';' before '{' token
Z.cpp:47:14: error: expected primary-expression before ']' token
Z.cpp:47:14: error: expected ';' before ']' token
Z.cpp:49:4: error: expected primary-expression before '{' token
Z.cpp:49:4: error: expected ']' before '{' token
Z.cpp:49:4: error: expected ';' before '{' token
Z.cpp:53:14: error: expected primary-expression before ']' token
Z.cpp:53:14: error: expected ';' before ']' token
Z.cpp:55:4: error: expected primary-expression before '{' token
Z.cpp:55:4: error: expected ']' before '{' token
Z.cpp:55:4: error: expected ';' before '{' token
Z.cpp:59:14: error: expected primary-expression before ']' token
Z.cpp:59:14: error: expected ';' before ']' token
Z.cpp:61:4: error: expected primary-expression before '{' token
Z.cpp:61:4: error: expected ']' before '{' token
Z.cpp:61:4: error: expected ';' before '{' token
Z.cpp:65:14: error: expected primary-expression before ']' token
Z.cpp:65:14: error: expected ';' before ']' token
Z.cpp:67:4: error: expected primary-expression before '{' token
Z.cpp:67:4: error: expected ']' before '{' token
Z.cpp:67:4: error: expected ';' before '{' token
Z.cpp:71:14: error: expected primary-expression before ']' token
Z.cpp:71:14: error: expected ';' before ']' token
Z.cpp:73:4: error: expected primary-expression before '{' token
Z.cpp:73:4: error: expected ']' before '{' token
Z.cpp:73:4: error: expected ';' before '{' token
Z.cpp:77:14: error: expected primary-expression before ']' token
Z.cpp:77:14: error: expected ';' before ']' token
Z.cpp:79:4: error: expected primary-expression before '{' token
Z.cpp:79:4: error: expected ']' before '{' token
Z.cpp:79:4: error: expected ';' before '{' token
Z.cpp:83:14: error: expected primary-expression before ']' token
Z.cpp:83:14: error: expected ';' before ']' token
Z.cpp:85:4: error: expected primary-expression before '{' token
Z.cpp:85:4: error: expected ']' before '{' token
Z.cpp:85:4: error: expected ';' before '{' token
Z.cpp:89:14: error: expected primary-expression before ']' token
Z.cpp:89:14: error: expected ';' before ']' token
Z.cpp:91:4: error: expected primary-expression before '{' token
Z.cpp:91:4: error: expected ']' before '{' token
Z.cpp:91:4: error: expected ';' before '{' token
Z.cpp:95:14: error: expected primary-expression before ']' token
Z.cpp:95:14: error: expected ';' before ']' token
Z.cpp:97:4: error: expected primary-expression before '{' token
Z.cpp:97:4: error: expected ']' before '{' token
Z.cpp:97:4: error: expected ';' before '{' token
Z.cpp:101:14: error: expected primary-expression before ']' token
Z.cpp:101:14: error: expected ';' before ']' token
Z.cpp:103:4: error: expected primary-expression before '{' token
Z.cpp:103:4: error: expected ']' before '{' token
Z.cpp:103:4: error: expected ';' before '{' token
Z.cpp:107:14: error: expected primary-expression before ']' token
Z.cpp:107:14: error: expected ';' before ']' token
Z.cpp:109:4: error: expected primary-expression before '{' token
Z.cpp:109:4: error: expected ']' before '{' token
Z.cpp:109:4: error: expected ';' before '{' token
Z.cpp:113:14: error: expected primary-expression before ']' token
Z.cpp:113:14: error: expected ';' before ']' token
Z.cpp:115:4: error: expected primary-expression before '{' token
Z.cpp:115:4: error: expected ']' before '{' token
Z.cpp:115:4: error: expected ';' before '{' token
Z.cpp:119:14: error: expected primary-expression before ']' token
Z.cpp:119:14: error: expected ';' before ']' token
Z.cpp:121:4: error: expected primary-expression before '{' token
Z.cpp:121:4: error: expected ']' before '{' token
Z.cpp:121:4: error: expected ';' before '{' token
Z.cpp:125:14: error: expected primary-expression before ']' token
Z.cpp:125:14: error: expected ';' before ']' token
Z.cpp:127:4: error: expected primary-expression before '{' token
Z.cpp:127:4: error: expected ']' before '{' token
Z.cpp:127:4: error: expected ';' before '{' token
Z.cpp:131:14: error: expected primary-expression before ']' token
Z.cpp:131:14: error: expected ';' before ']' token
Z.cpp:133:4: error: expected primary-expression before '{' token
Z.cpp:133:4: error: expected ']' before '{' token
Z.cpp:133:4: error: expected ';' before '{' token
Z.cpp:137:14: error: expected primary-expression before ']' token
Z.cpp:137:14: error: expected ';' before ']' token
Z.cpp:139:4: error: expected primary-expression before '{' token
Z.cpp:139:4: error: expected ']' before '{' token
Z.cpp:139:4: error: expected ';' before '{' token
Z.cpp:143:14: error: expected primary-expression before ']' token
Z.cpp:143:14: error: expected ';' before ']' token
Z.cpp:145:4: error: expected primary-expression before '{' token
Z.cpp:145:4: error: expected ']' before '{' token
Z.cpp:145:4: error: expected ';' before '{' token
Z.cpp:149:14: error: expected primary-expression before ']' token
Z.cpp:149:14: error: expected ';' before ']' token
Z.cpp:151:4: error: expected primary-expression before '{' token
Z.cpp:151:4: error: expected ']' before '{' token
Z.cpp:151:4: error: expected ';' before '{' token
Z.cpp:155:14: error: expected primary-expression before ']' token
Z.cpp:155:14: error: expected ';' before ']' token
Z.cpp:157:4: error: expected primary-expression before '{' token
Z.cpp:157:4: error: expected ']' before '{' token
Z.cpp:157:4: error: expected ';' before '{' token
Z.cpp:161:14: error: expected primary-expression before ']' token
Z.cpp:161:14: error: expected ';' before ']' token
Z.cpp:163:4: error: expected primary-expression before '{' token
Z.cpp:163:4: error: expected ']' before '{' token
Z.cpp:163:4: error: expected ';' before '{' token
Z.cpp:167:14: error: expected primary-expression before ']' token
Z.cpp:167:14: error: expected ';' before ']' token
Z.cpp:169:4: error: expected primary-expression before '{' token
Z.cpp:169:4: error: expected ']' before '{' token
Z.cpp:169:4: error: expected ';' before '{' token
Z.cpp:173:14: error: expected primary-expression before ']' token
Z.cpp:173:14: error: expected ';' before ']' token
Z.cpp:175:4: error: expected primary-expression before '{' token
Z.cpp:175:4: error: expected ']' before '{' token
Z.cpp:175:4: error: expected ';' before '{' token
Z.cpp:179:14: error: expected primary-expression before ']' token
Z.cpp:179:14: error: expected ';' before ']' token
Z.cpp:181:4: error: expected primary-expression before '{' token
Z.cpp:181:4: error: expected ']' before '{' token
Z.cpp:181:4: error: expected ';' before '{' token
Z.cpp:185:14: error: expected primary-expression before ']' token
Z.cpp:185:14: error: expected ';' before ']' token
Z.cpp:187:4: error: expected primary-expression before '{' token
Z.cpp:187:4: error: expected ']' before '{' token
Z.cpp:187:4: error: expected ';' before '{' token
Z.cpp:191:14: error: expected primary-expression before ']' token
Z.cpp:191:14: error: expected ';' before ']' token
Z.cpp:193:4: error: expected primary-expression before '{' token
Z.cpp:193:4: error: expected ']' before '{' token
Z.cpp:193:4: error: expected ';' before '{' token
Z.cpp:197:14: error: expected primary-expression before ']' token
Z.cpp:197:14: error: expected ';' before ']' token
Z.cpp:199:4: error: expected primary-expression before '{' token
Z.cpp:199:4: error: expected ']' before '{' token
Z.cpp:199:4: error: expected ';' before '{' token
Z.cpp:203:14: error: expected primary-expression before ']' token
Z.cpp:203:14: error: expected ';' before ']' token
Z.cpp:205:4: error: expected primary-expression before '{' token
Z.cpp:205:4: error: expected ']' before '{' token
Z.cpp:205:4: error: expected ';' before '{' token
Z.cpp:209:14: error: expected primary-expression before ']' token
Z.cpp:209:14: error: expected ';' before ']' token
Z.cpp:211:4: error: expected primary-expression before '{' token
Z.cpp:211:4: error: expected ']' before '{' token
Z.cpp:211:4: error: expected ';' before '{' token
Z.cpp:215:14: error: expected primary-expression before ']' token
Z.cpp:215:14: error: expected ';' before ']' token
Z.cpp:217:4: error: expected primary-expression before '{' token
Z.cpp:217:4: error: expected ']' before '{' token
Z.cpp:217:4: error: expected ';' before '{' token
Z.cpp:221:14: error: expected primary-expression before ']' token
Z.cpp:221:14: error: expected ';' before ']' token
Z.cpp:222:4: error: expected primary-expression before '{' token
Z.cpp:222:4: error: expected ']' before '{' token
Z.cpp:222:4: error: expected ';' before '{' token
Z.cpp:226:14: error: expected primary-expression before ']' token
Z.cpp:226:14: error: expected ';' before ']' token
Z.cpp:227:4: error: expected primary-expression before '{' token
Z.cpp:227:4: error: expected ']' before '{' token
Z.cpp:227:4: error: expected ';' before '{' token
Z.cpp:231:14: error: expected primary-expression before ']' token
Z.cpp:231:14: error: expected ';' before ']' token
Z.cpp:232:4: error: expected primary-expression before '{' token
Z.cpp:232:4: error: expected ']' before '{' token
Z.cpp:232:4: error: expected ';' before '{' token
Z.cpp:236:14: error: expected primary-expression before ']' token
Z.cpp:236:14: error: expected ';' before ']' token
Z.cpp:237:4: error: expected primary-expression before '{' token
Z.cpp:237:4: error: expected ']' before '{' token
Z.cpp:237:4: error: expected ';' before '{' token
Z.cpp:241:14: error: expected primary-expression before ']' token
Z.cpp:241:14: error: expected ';' before ']' token
Z.cpp:242:4: error: expected primary-expression before '{' token
Z.cpp:242:4: error: expected ']' before '{' token
Z.cpp:242:4: error: expected ';' before '{' token
Z.cpp:246:14: error: expected primary-expression before ']' token
Z.cpp:246:14: error: expected ';' before ']' token
Z.cpp:248:4: error: expected primary-expression before '{' token
Z.cpp:248:4: error: expected ']' before '{' token
Z.cpp:248:4: error: expected ';' before '{' token
Z.cpp:252:14: error: expected primary-expression before ']' token
Z.cpp:252:14: error: expected ';' before ']' token