Skip to content

Instantly share code, notes, and snippets.

@ZengetsuFR
ZengetsuFR / Chevaux de course
Last active August 29, 2015 14:22
Résolution du jeu "Chevaux de course" sur le site codingame.com
import sys, math
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
N = int(raw_input())
lstValue = []
lstSorted = []
ecartDico = []
@ZengetsuFR
ZengetsuFR / Défibrillateur
Created June 3, 2015 07:33
Résolution du jeu "Défibrillateur" sur le site codingame.com
import sys, math, re
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
def deg2Rad(deg):
return deg * (math.pi/180)
def transformToFloat(value):
result = 0
@ZengetsuFR
ZengetsuFR / MIME Type
Created June 3, 2015 07:15
Résolution du jeu "MIME Type" sur le site codingame.com
import sys, math,re
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
N = int(raw_input()) # Number of elements which make up the association table.
Q = int(raw_input()) # Number Q of file names to be analyzed.
d ={}
#dico avec extension en cle et le type mime pour valeur
@ZengetsuFR
ZengetsuFR / Chuck Norris
Created June 3, 2015 07:07
Résolution du jeu "Chuck Norris" sur le site codingame.com
import sys, math, binascii
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
MESSAGE = raw_input()
string =""
result =""
#convertir code ascii en binaire
@ZengetsuFR
ZengetsuFR / ASCII Art
Created June 3, 2015 07:05
Résolution du jeu "ASCII Art" sur le site codingame.com
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
@ZengetsuFR
ZengetsuFR / Températures
Created June 3, 2015 07:03
Résolution du jeu "Températures" sur le site codingame.com
import sys, math
from bisect import bisect_left
from bisect import bisect_right
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
N = int(raw_input()) # the number of temperatures to analyse
TEMPS = raw_input() # the N temperatures expressed as integers ranging from -273 to 5526
@ZengetsuFR
ZengetsuFR / Mars Lander
Created June 3, 2015 06:52
Résolution du jeu "Mars Lander" sur le site codingame.com
import sys, math
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
N = int(raw_input()) # the number of points used to draw the surface of Mars.
for i in xrange(N):
# LAND_X: X coordinate of a surface point. (0 to 6999)
# LAND_Y: Y coordinate of a surface point. By linking all the points together in a sequential fashion, you form the surface of Mars.
LAND_X, LAND_Y = [int(j) for j in raw_input().split()]
@ZengetsuFR
ZengetsuFR / Los Angeles, 2029
Created June 3, 2015 06:51
Résolution du jeu "Los Angeles, 2029..." sur le site codingame.com
import sys, math
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
LongueurPontAvantTrou = int(raw_input()) # the length of the road before the gap.
LongueurTrou = int(raw_input()) # the length of the gap.
LongueurPontApresTrou = int(raw_input()) # the length of the landing platform.
# game loop
@ZengetsuFR
ZengetsuFR / La descente
Created June 3, 2015 06:49
Résolution du jeu "La descente" sur le site codingame.com
import sys, math
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
# game loop
while 1:
SX, SY = [int(i) for i in raw_input().split()]
hauteurMontagne = {}
for i in xrange(8):
MH = int(raw_input()) # represents the height of one mountain, from 9 to 0. Mountain heights are provided from left to right.
@ZengetsuFR
ZengetsuFR / Thor
Last active August 29, 2015 14:22
Résolution du jeu "Thor" sur le site codingame.com
EX,EY,JX,JY=[int(i) for i in raw_input().split()]
#il n'est pas nécessaire de prendre en compte le NORD
#Les tests ne prennent jamais en compte cette direction
while 1:
if EY>JY:
if EX>JX:print 'SE';JX+=1;JY+=1
elif EX<JX:print 'SW';JX-=1;JY+=1
else:print 'S';JY+=1
if EY==JY:
if EX>JX:print 'E';JX+=1