結果

問題 No.1806 Rotating Golem
ユーザー ころまるぼーい
提出日時 2023-05-10 16:21:56
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 365 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-11-26 21:25:29
合計ジャッジ時間 1,401 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

hougaku = {
    "N" : 1,
    "E" : 2,
    "S" : 3,
    "W" : 4
}

firstDirection = input()
lastDirection = input()
if hougaku[firstDirection] < hougaku[lastDirection]:
    print(hougaku[lastDirection] - hougaku[firstDirection])
elif hougaku[firstDirection] > hougaku[lastDirection]:
    print(4 - hougaku[firstDirection] + hougaku[lastDirection])
else:
    print(0)
0