結果

問題 No.113 宝探し
ユーザー kohei2019kohei2019
提出日時 2021-06-02 22:22:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 5,000 ms
コード長 213 bytes
コンパイル時間 202 ms
コンパイル使用メモリ 82,400 KB
実行使用メモリ 54,108 KB
最終ジャッジ日時 2024-04-27 15:14:27
合計ジャッジ時間 2,484 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,772 KB
testcase_01 AC 41 ms
52,680 KB
testcase_02 AC 40 ms
53,048 KB
testcase_03 AC 39 ms
53,076 KB
testcase_04 AC 39 ms
52,292 KB
testcase_05 AC 39 ms
53,276 KB
testcase_06 AC 39 ms
51,888 KB
testcase_07 AC 39 ms
52,736 KB
testcase_08 AC 40 ms
52,128 KB
testcase_09 AC 40 ms
52,928 KB
testcase_10 AC 39 ms
52,496 KB
testcase_11 AC 39 ms
53,140 KB
testcase_12 AC 39 ms
53,204 KB
testcase_13 AC 39 ms
53,296 KB
testcase_14 AC 39 ms
52,336 KB
testcase_15 AC 40 ms
53,584 KB
testcase_16 AC 39 ms
52,164 KB
testcase_17 AC 40 ms
52,532 KB
testcase_18 AC 39 ms
52,552 KB
testcase_19 AC 39 ms
52,872 KB
testcase_20 AC 41 ms
52,616 KB
testcase_21 AC 39 ms
52,872 KB
testcase_22 AC 40 ms
54,108 KB
testcase_23 AC 40 ms
53,008 KB
testcase_24 AC 40 ms
53,216 KB
testcase_25 AC 40 ms
52,376 KB
testcase_26 AC 39 ms
53,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
N = len(S)
x = 0
y = 0
for i in range(N):
    if S[i] == 'N':
        y += 1
    elif S[i] == 'E':
        x += 1
    elif S[i] == 'W':
        x -= 1
    else:
        y -= 1
print((x**2+y**2)**(1/2))
0