結果
問題 |
No.331 CodeRunnerでやれ
|
ユーザー |
![]() |
提出日時 | 2016-02-25 20:31:48 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 455 ms / 5,000 ms |
コード長 | 633 bytes |
コンパイル時間 | 163 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 27,616 KB |
平均クエリ数 | 399.88 |
最終ジャッジ日時 | 2024-07-16 22:57:51 |
合計ジャッジ時間 | 7,478 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 16 |
ソースコード
#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')