結果

問題 No.331 CodeRunnerでやれ
ユーザー soupesuteakasoupesuteaka
提出日時 2016-02-25 20:31:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 422 ms / 5,000 ms
コード長 633 bytes
コンパイル時間 556 ms
コンパイル使用メモリ 10,884 KB
実行使用メモリ 25,476 KB
平均クエリ数 399.88
最終ジャッジ日時 2023-09-23 23:12:40
合計ジャッジ時間 6,879 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 188 ms
24,868 KB
testcase_01 AC 187 ms
25,384 KB
testcase_02 AC 202 ms
24,864 KB
testcase_03 AC 277 ms
25,232 KB
testcase_04 AC 185 ms
25,180 KB
testcase_05 AC 200 ms
24,828 KB
testcase_06 AC 419 ms
25,300 KB
testcase_07 AC 333 ms
25,360 KB
testcase_08 AC 422 ms
25,160 KB
testcase_09 AC 238 ms
25,220 KB
testcase_10 AC 262 ms
24,968 KB
testcase_11 AC 227 ms
25,388 KB
testcase_12 AC 351 ms
24,788 KB
testcase_13 AC 276 ms
24,804 KB
testcase_14 AC 369 ms
25,020 KB
testcase_15 AC 291 ms
25,020 KB
testcase_16 AC 397 ms
25,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#coding: UTF-8

import sys
import re
import itertools
from collections import deque

""" defs """

""" main """
searched_point = list( [0]*50 for _ in range(50) )
dx = [1,0,-1,0]
dy = [0,-1,0,1]

st = [[0,0,0,4]]
searched_point[0][0] = 1

while True:
	s = input()
	if (s[0]=='M'):
		break
	d = int(s)
	if (d==20151224):
		print('F')
		continue

	x,y,drct,f = el = st[-1]
	nx = x + dx[drct]
	ny = y + dy[drct]
	if (d != 0 and searched_point[ny][nx]==False):
		print('F')
		st.append([nx,ny,drct,4])
		searched_point[ny][nx]=1
	else:
		if (f==0):
			print('B')
			st.pop()
		else:
			el[2] = (drct+1) % 4
			el[3] = f-1
			print('L')
	
0