結果
問題 |
No.228 ゆきこちゃんの 15 パズル
|
ユーザー |
|
提出日時 | 2016-03-29 19:22:32 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 474 bytes |
コンパイル時間 | 39 ms |
コンパイル使用メモリ | 7,680 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-10-02 07:27:51 |
合計ジャッジ時間 | 2,689 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 WA * 4 |
コンパイルメッセージ
Syntax OK
ソースコード
def hoge x, a if a[x - 1] == x return true end if x % 4 != 0 && a[x] == x return true end if x % 4 != 1 && a[x - 2] == x return true end if x > 4 && a[x - 5] == x return true end if (x - 1) / 4 != 3 && a[x + 3] == x return true end return false end a = STDIN.map{|s|s.split.map(&:to_i)}.flatten 1.upto(15){|x| if hoge(x, a) next end puts 'No' exit } puts 'Yes'