結果

問題 No.113 宝探し
ユーザー ssmkzkssmkzk
提出日時 2018-06-08 15:55:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 562 ms / 5,000 ms
コード長 238 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 44,428 KB
最終ジャッジ日時 2024-04-28 08:15:02
合計ジャッジ時間 17,313 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 546 ms
43,784 KB
testcase_01 AC 540 ms
44,040 KB
testcase_02 AC 536 ms
44,164 KB
testcase_03 AC 554 ms
43,824 KB
testcase_04 AC 554 ms
43,912 KB
testcase_05 AC 556 ms
44,428 KB
testcase_06 AC 562 ms
43,912 KB
testcase_07 AC 549 ms
44,168 KB
testcase_08 AC 550 ms
43,912 KB
testcase_09 AC 541 ms
44,168 KB
testcase_10 AC 545 ms
44,176 KB
testcase_11 AC 543 ms
43,912 KB
testcase_12 AC 546 ms
44,044 KB
testcase_13 AC 541 ms
44,048 KB
testcase_14 AC 541 ms
44,048 KB
testcase_15 AC 541 ms
43,912 KB
testcase_16 AC 549 ms
44,168 KB
testcase_17 AC 550 ms
43,904 KB
testcase_18 AC 536 ms
43,900 KB
testcase_19 AC 542 ms
44,032 KB
testcase_20 AC 542 ms
44,172 KB
testcase_21 AC 550 ms
44,176 KB
testcase_22 AC 549 ms
44,040 KB
testcase_23 AC 545 ms
44,300 KB
testcase_24 AC 547 ms
43,912 KB
testcase_25 AC 536 ms
44,040 KB
testcase_26 AC 540 ms
44,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

S = input()
Y = 0
T = 0
for i in S:
    if i == "N":
        T += 1
    elif i == "E":
        Y += 1
    elif i == "W":
        Y -= 1
    elif i == "S":
        T -= 1

ans = np.sqrt(abs(Y)**2 + abs(T)**2)
print(ans)
0