結果

問題 No.113 宝探し
ユーザー soupesuteaka
提出日時 2016-03-03 17:46:20
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 32 ms / 5,000 ms
コード長 302 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-11-16 21:10:47
合計ジャッジ時間 1,775 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#coding: UTF-8

import sys
import re
import itertools
from math import sqrt
from collections import deque

### defs ###

### main ###
S = sys.stdin.readline().strip('\r\n')

x,y=(0,0)
dir = {'N':(0,1), 'E':(1,0), 'W':(-1,0), 'S':(0,-1)}
for c in S:
	x += dir[c][0]
	y += dir[c][1]
print(sqrt(x*x+y*y))
0