結果
| 問題 |
No.113 宝探し
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-04-22 21:43:28 |
| 言語 | Python2 (2.7.18) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 260 bytes |
| コンパイル時間 | 63 ms |
| コンパイル使用メモリ | 7,040 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-05 00:20:13 |
| 合計ジャッジ時間 | 1,284 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 RE * 2 |
| other | AC * 4 WA * 1 RE * 18 |
ソースコード
#!/usr/bin/python
from collections import Counter
dic = {
'N': (0, 1),
'E': (1, 0),
'W': (-1, 0),
'S': (0, -1),
}
S = raw_input()
counter = Counter(S)
x, y = map(sum, zip(*map(lambda (k, v): dic[k]*v, counter.items())))
print (x*x + y*y) ** .5