結果
問題 |
No.113 宝探し
|
ユーザー |
![]() |
提出日時 | 2023-09-26 17:47:51 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 42 ms / 5,000 ms |
コード長 | 203 bytes |
コンパイル時間 | 433 ms |
コンパイル使用メモリ | 82,416 KB |
実行使用メモリ | 52,352 KB |
最終ジャッジ日時 | 2024-07-19 11:44:42 |
合計ジャッジ時間 | 1,920 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 23 |
ソースコード
import math s = input() NW = {"N": (1, 0), "S": (-1, 0), "W": (0, -1), "E": (0, 1)} dir = [0, 0] for c in s: dir[0] += NW[c][0] dir[1] += NW[c][1] print(math.sqrt(dir[0] ** 2 + dir[1] ** 2))