結果
| 問題 |
No.113 宝探し
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-08-04 12:46:30 |
| 言語 | Go (1.23.4) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 262 bytes |
| コンパイル時間 | 14,879 ms |
| コンパイル使用メモリ | 237,396 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-16 22:07:48 |
| 合計ジャッジ時間 | 11,375 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 23 |
ソースコード
package main
import (
"fmt"
"math"
)
func main() {
var s string
var x, y int
fmt.Scan(&s)
for _, v := range s {
switch v {
case 'N':
y++
case 'S':
y--
case 'E':
x++
case 'W':
x--
}
}
fmt.Println(math.Sqrt(float64(x*x + y*y)))
}