結果

問題 No.870 無敵囲い
ユーザー maimai
提出日時 2019-08-30 21:24:19
言語 Ruby
(3.3.0)
結果
AC  
実行時間 84 ms / 300 ms
コード長 259 bytes
コンパイル時間 504 ms
コンパイル使用メモリ 11,344 KB
実行使用メモリ 15,348 KB
最終ジャッジ日時 2023-09-11 16:06:20
合計ジャッジ時間 3,751 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,176 KB
testcase_01 AC 84 ms
15,148 KB
testcase_02 AC 82 ms
15,152 KB
testcase_03 AC 83 ms
15,260 KB
testcase_04 AC 83 ms
15,032 KB
testcase_05 AC 82 ms
15,132 KB
testcase_06 AC 82 ms
15,236 KB
testcase_07 AC 82 ms
15,160 KB
testcase_08 AC 81 ms
15,036 KB
testcase_09 AC 82 ms
15,016 KB
testcase_10 AC 82 ms
15,260 KB
testcase_11 AC 83 ms
15,032 KB
testcase_12 AC 83 ms
15,152 KB
testcase_13 AC 83 ms
15,296 KB
testcase_14 AC 83 ms
15,192 KB
testcase_15 AC 83 ms
15,292 KB
testcase_16 AC 83 ms
15,348 KB
testcase_17 AC 83 ms
15,036 KB
testcase_18 AC 83 ms
15,280 KB
testcase_19 AC 82 ms
15,156 KB
testcase_20 AC 82 ms
15,264 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def lscan; gets.split.map(&:to_i); end

h = {}
h[[2,8]] = 1
h[[3,9]] = 2
h[[7,9]] = 3

gets.to_i.times do
  a,b,c,d = lscan
  i = h[[a,b]]
  h[[a,b]] = 0
  h[[c,d]] = i
end


if h[[5,8]] == 1 && h[[4,8]] == 2 && h[[6,8]] == 3
  puts 'YES'
else
  puts 'NO'
end
0