이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |