結果

問題 No.870 無敵囲い
ユーザー Takuya NoguchiTakuya Noguchi
提出日時 2019-10-27 01:44:20
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 378 bytes
コンパイル時間 55 ms
コンパイル使用メモリ 11,460 KB
実行使用メモリ 22,224 KB
最終ジャッジ日時 2023-09-11 16:19:27
合計ジャッジ時間 2,297 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
22,224 KB
testcase_01 AC 84 ms
15,160 KB
testcase_02 AC 79 ms
15,016 KB
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

muteki_gakoi_movement = {
  '7 9' => '6 8',
  '2 8' => '5 8',
  '3 9' => '4 8'
}

movement = {}
gets.to_i.times do
  x1, y1, x2, y2 = gets.split.map(&:to_i)
  movement[[x1, y1].join(' ')] = [x2, y2].join(' ')
end

puts muteki_gakoi_movement.all? { |start_p, end_p|
  current = start_p
  while current = movement[current]
    break true if current == end_p
  end
} ? 'YES' : 'NO'
0