結果
| 問題 |
No.1806 Rotating Golem
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-07 01:41:39 |
| 言語 | Go (1.23.4) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 395 bytes |
| コンパイル時間 | 12,033 ms |
| コンパイル使用メモリ | 221,028 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-29 13:39:06 |
| 合計ジャッジ時間 | 12,892 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 |
ソースコード
// No.1806 Rotating Golem
package main
import (
"fmt"
)
func main() {
var a, b string
fmt.Scan(&a, &b)
f := func(s string) int {
switch s {
case "N":
return 0
case "E":
return 1
case "S":
return 2
case "W":
return 3
}
return -1
}
if a == b {
fmt.Println(0)
} else if f(a) < f(b) {
fmt.Println(f(b) - f(a))
} else {
fmt.Println((f(b) + 4) - f(a))
}
}