Created
June 3, 2015 06:49
-
-
Save ZengetsuFR/778ebd52159f70107f88 to your computer and use it in GitHub Desktop.
Résolution du jeu "La descente" 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 | |
# 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