結果
問題 |
No.113 宝探し
|
ユーザー |
![]() |
提出日時 | 2020-11-28 19:49:42 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 31 ms / 5,000 ms |
コード長 | 418 bytes |
コンパイル時間 | 442 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-09-12 23:31:36 |
合計ジャッジ時間 | 1,842 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 23 |
ソースコード
import math inputer = input() north=0 east=0 west=0 south=0 for hogaku in range(len(inputer)): if inputer[hogaku]=="N": north=north+1 if inputer[hogaku]=="E": east=east+1 if inputer[hogaku]=="W": west=west+1 if inputer[hogaku]=="S": south=south+1 tate = north-south yoko = east-west tete_k = int(math.pow(tate,2)) yoko_k = int(math.pow(yoko,2)) kyori =int(tete_k+yoko_k) print(round(math.sqrt(kyori),5))