結果
| 問題 | No.113 宝探し |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-21 19:36:54 |
| 言語 | Python3 (3.14.3 + numpy 2.4.2 + scipy 1.17.0) |
| 結果 |
AC
|
| 実行時間 | 98 ms / 5,000 ms |
| コード長 | 459 bytes |
| 記録 | |
| コンパイル時間 | 466 ms |
| コンパイル使用メモリ | 20,828 KB |
| 実行使用メモリ | 15,612 KB |
| 最終ジャッジ日時 | 2026-03-21 23:19:37 |
| 合計ジャッジ時間 | 4,243 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 23 |
ソースコード
from math import sqrt
def main():
S = input()
destination = [0, 0]
for direction in S:
match direction:
case "N":
destination[1] += 1
case "S":
destination[1] -= 1
case "E":
destination[0] += 1
case "W":
destination[0] -= 1
print(sqrt(destination[0] ** 2 + destination[1] ** 2))
if __name__ == "__main__":
main()