Last active
August 29, 2015 14:25
-
-
Save QuincyLarson/ff1dbc5a478b6fe463d9 to your computer and use it in GitHub Desktop.
noob247365's solution to https://www.codingame.com/ide/16459724f206ed16bee39598553d2c39993eb7a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Auto-generated code below aims at helping you parse | |
* the standard input according to the problem statement. | |
**/ | |
var L = parseInt(readline()); | |
var H = parseInt(readline()); | |
var T = readline().toUpperCase(); | |
var ascii = [[]]; | |
for (var i = 0; i < H; i++) { | |
var ROW = readline(); | |
ascii[i] = []; | |
for (var j = 0; j < 27; j += 1 ) { | |
ascii[i][j] = ROW.substr(L * j, L); | |
} | |
} | |
var ascii_A = 'A'.charCodeAt(0); | |
var ascii_Z = 'Z'.charCodeAt(0); | |
var N = T.length; | |
var res = ''; | |
for (var i = 0; i < H; i++) { | |
for(var j = 0; j < N; j++) { | |
var ch = T.charCodeAt(j); | |
if(ch >= ascii_A && ch <= ascii_Z) { | |
ch -= ascii_A; | |
res += ascii[i][ch]; | |
} else { | |
res += ascii[i][26]; | |
} | |
} | |
res = res + '\n'; | |
} | |
print(res); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment