結果
問題 |
No.113 宝探し
|
ユーザー |
![]() |
提出日時 | 2020-01-26 20:03:02 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 332 bytes |
コンパイル時間 | 14,224 ms |
コンパイル使用メモリ | 230,468 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-16 22:27:02 |
合計ジャッジ時間 | 14,730 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 23 |
ソースコード
package main import ( "fmt" "math" ) func main() { var x, y int var s string fmt.Scan(&s) for i := 0; i < len(s); i++ { if s[i] == 'N' { y++ } else if s[i] == 'S' { y-- } else if s[i] == 'E' { x++ } else { x-- } } // fmt.Println("x", x, "y", y) fmt.Println(math.Sqrt(float64(x*x) + float64(y*y))) }