Skip to content

Instantly share code, notes, and snippets.

@ZengetsuFR
Created June 3, 2015 06:49
Show Gist options
  • Save ZengetsuFR/778ebd52159f70107f88 to your computer and use it in GitHub Desktop.
Save ZengetsuFR/778ebd52159f70107f88 to your computer and use it in GitHub Desktop.
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.
if MH>0:
hauteurMontagne[i] = MH
hauteurMontagneTrier = sorted(hauteurMontagne,key=hauteurMontagne.__getitem__,reverse=True)
montagneLaPlusHaute = hauteurMontagneTrier[0]
if montagneLaPlusHaute == SX:
print "FIRE"
else:
print "HOLD"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment