結果
| 問題 |
No.1806 Rotating Golem
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-02-04 21:34:29 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 79 ms / 2,000 ms |
| コード長 | 207 bytes |
| コンパイル時間 | 153 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 12,416 KB |
| 最終ジャッジ日時 | 2024-06-11 11:32:28 |
| 合計ジャッジ時間 | 1,985 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 |
コンパイルメッセージ
Syntax OK
ソースコード
a = gets.chomp.to_sym
b = gets.chomp.to_sym
directions = { E: 1, S: 2, W: 3, N: 4 }
if directions[a] <= directions[b]
puts (directions[b] - directions[a])
else
puts 4 - directions[a] + directions[b]
end