結果
問題 | No.113 宝探し |
ユーザー | tsuchinaga |
提出日時 | 2019-02-22 12:07:02 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 280 bytes |
コンパイル時間 | 12,974 ms |
コンパイル使用メモリ | 238,392 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-16 22:01:04 |
合計ジャッジ時間 | 13,791 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 23 |
ソースコード
package main import ( "fmt" "math" ) func main() { var s string var x, y float64 _, _ = fmt.Scan(&s) for _, r := range []rune(s) { switch string(r) { case "N": y++ case "E": x++ case "W": x-- case "S": y-- } } fmt.Print(math.Sqrt(x*x + y*y)) }