Created
June 3, 2015 07:05
-
-
Save ZengetsuFR/16fc5257923fddfb2745 to your computer and use it in GitHub Desktop.
Résolution du jeu "ASCII Art" sur le site codingame.com
This file contains hidden or 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
import sys, math, re, string | |
# Auto-generated code below aims at helping you parse | |
# the standard input according to the problem statement. | |
L = int(raw_input()) | |
H = int(raw_input()) | |
T = raw_input() | |
T = T.upper() #on passe le texte en majuscule | |
alpha = string.ascii_uppercase + "?" #chaine de string avec toutes les lettres de l'alphabet + ? | |
for i in xrange(H): | |
ROW = raw_input() | |
lettre = "" | |
for char in T: | |
#on cherche la position de char dans la chaine alphabetique | |
index = alpha.find("?")*L if alpha.find(char)==-1 else alpha.find(char) * L | |
lettre = lettre + ROW[index:index+L] | |
print lettre |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment