Codingame : Power Of Thor - Episode 1 - Velog
Maybe your like
hoony.log로그인hoony.log로그인Codingame : Power of Thor - Episode 1Root(√)·2020년 8월 27일팔로우0python알고리즘
Root(√)Software Engineer팔로우이전 포스트
자료구조&알고리즘
목록 보기6/7https://www.codingame.com/training/easy/power-of-thor-episode-1
오늘 토르 라그나로크를 보고 나니 이 문제를 풀고 싶어져서 풀어봤다.
import sys import math # Auto-generated code below aims at helping you parse # the standard input according to the problem statement. # --- # Hint: You can use the debug stream to print initialTX and initialTY, if Thor seems not follow your orders. # light_x: the X position of the light of power # light_y: the Y position of the light of power # initial_tx: Thor's starting X position # initial_ty: Thor's starting Y position light_x, light_y, initial_tx, initial_ty = [int(i) for i in input().split()] # game loop while True: remaining_turns = int(input()) # The remaining amount of turns Thor can move. Do not remove this line. # Write an action using print # To debug: print("Debug messages...", file=sys.stderr, flush=True) # N if light_y < initial_ty and light_x == initial_tx : initial_ty -= 1 print("N") # NE elif light_x > initial_tx and light_y < initial_ty: initial_tx += 1 initial_ty -= 1 print("NE") # E elif light_x > initial_tx and light_y == initial_ty: initial_tx += 1 print("E") # SE elif light_x > initial_tx and light_y > initial_ty: initial_tx += 1 initial_ty += 1 print("SE") # S elif light_y > initial_ty and light_x == initial_tx : initial_ty += 1 print("S") # SW elif light_x < initial_tx and light_y > initial_ty: initial_tx -= 1 initial_ty += 1 print("SW") # W elif light_x < initial_tx and light_y == initial_ty: initial_tx -= 1 print("W") # NW else: initial_tx -= 1 initial_ty -= 1 print("NW") # A single line providing the move to be made: N NE E SE S SW W or NW
Root(√)Software Engineer팔로우이전 포스트기차에서 심심해서
다음 포스트Codingame : mars-lander-episode-1
0개의 댓글
댓글 작성Tag » Codingame Power Of Thor Solution Python
-
Solution Of Codingame Power Of Thor. (python 3) - Gists · GitHub
-
Codingame/power-of-thor-episode- At Master - GitHub
-
[Python] |Power Of Thor: Episode 1 | CodinGame Solution - YouTube
-
CodinGame Solo Puzzle - Power Of Thor - Solved By Etienne THIERY
-
Codingame Solution: Power Of Thor - Episode 1
-
Practice Conditions With The Exercise "Power Of Thor - Episode 1"
-
Developer Discussion About "Power Of Thor - Episode 2"
-
Master Hellish On Twitter: "🎥 NEW VIDEO 🎥 CodinGame Python - E4
-
[C] Codingame Easy "power-of-thor-episode-1" - Replit
-
Modify The Following Code To Fit The Constraints Of Power Of Thor (cx
-
Category: Codingame - Kai Wang's Blog
-
I Don't Understand The Difference Between My Code And The ... - Reddit
-
Github Codingame Solutions Java - Infomedical
-
CodinGame: Power Of Thor-Episode 1 Golang Code - Krybot