Submission #19215

#TimeUsernameProblemLanguageResultExecution timeMemory
19215joonasZu (kriii2_Z)C++98
1 / 4
12 ms1852 KiB
#include <bits/stdc++.h> using namespace std; #define NUMBER_OF_GLYPHIC 10 string mapping[NUMBER_OF_GLYPHIC][5]={ { // _ ".....", ".....", ".....", ".....", "....." }, { // 3 "#####", "#.#.#", "#.###", "#...#", "#####" }, { // 3 (2) "#####", "#...#", "#.#.#", "#.#.#", "#####" }, { // 10 "#####", "#.#.#", "#####", "#.#.#", "#####" }, { // a "#####", "..#..", "#...#", "#####", "#####" }, { // b "#####", "#...#", "#.#.#", "....#", "#####" }, { // c "#####", "###..", "###.#", "###..", "#####" }, { // d "#####", "#####", "#####", "..###", "#.###" }, { // kq "###.#", "###.#", "###.#", "#...#", "#.###" }, { // uv "#####", "#####", "#####", "#...#", "#.#.#" } }; string encode[NUMBER_OF_GLYPHIC]={ "_","3","3","10","a","b","c","d","kq","uv" }; string finder(string s[], int y, int x){ for(int idx=0; idx<NUMBER_OF_GLYPHIC; ++idx){ bool isSame = true; for(int i=0; i<5; ++i) isSame &= s[y+i].substr(x, 5) == mapping[idx][i]; if(isSame) return encode[idx]; } return "z"; } int main(){ string s[350]; int i, j, k, r, c; cin >> r >> c; for(i=0; i<6*r-1; ++i) cin >> s[i]; for(j=6*(c-1); j>=0; j -= 6){ for(i=0; i<6*r; i += 6){ cout<< finder(s, i, j); } cout<<'\n'; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...