結果

問題 No.113 宝探し
コンテスト
ユーザー k.h
提出日時 2019-08-04 12:46:30
言語 Go
(1.27.2 + ACL)
コンパイル:
/usr/bin/go_c
実行:
./Main
結果
AC  
実行時間 1 ms / 5,000 ms
+ 530µs
コード長 262 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 13,816 ms
コンパイル使用メモリ 272,816 KB
実行使用メモリ 9,836 KB
最終ジャッジ日時 2026-09-25 01:41:17
合計ジャッジ時間 15,066 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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)))
}
0