結果

問題 No.1806 Rotating Golem
ユーザー tokutaro
提出日時 2022-02-12 22:21:36
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 278 bytes
コンパイル時間 246 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,368 KB
最終ジャッジ日時 2024-06-29 01:36:43
合計ジャッジ時間 1,506 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

A = input()
B = input()
direction = ['N','E','S','W']
result = 0
ind = 0
if A == 'N':
    ind = 0
elif A == 'E':
    ind = 1
elif A == 'S':
    ind = 2
else:
    ind = 3
cur_A = A
while cur_A != B:
    ind += 1
    cur_A = direction[ind % 4]
    result += 1
print(result)


    
0