結果
| 問題 | No.113 宝探し |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-08-04 12:46:30 |
| 言語 | Go (1.26.1) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 262 bytes |
| 記録 | |
| コンパイル時間 | 14,750 ms |
| コンパイル使用メモリ | 288,200 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-12 03:25:27 |
| 合計ジャッジ時間 | 16,175 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / tmp-judge_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)))
}