結果

問題 No.113 宝探し
ユーザー yuppe19 😺
提出日時 2015-04-22 21:46:51
言語 Python2
(2.7.18)
結果
AC  
実行時間 14 ms / 5,000 ms
コード長 327 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,784 KB
最終ジャッジ日時 2024-11-16 20:50:27
合計ジャッジ時間 1,640 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
from collections import Counter
dic = {
    'N': (0, 1),
    'E': (1, 0),
    'W': (-1, 0),
    'S': (0, -1),
}
calc_distance = lambda (k, v): map(lambda v: v*counter[k], dic[k])

S = raw_input()
counter = Counter(S)
arr = map(calc_distance, counter.items())
x, y = map(sum, zip(*arr))
print (x*x + y*y) ** .5
0