結果
問題 | No.870 無敵囲い |
ユーザー |
|
提出日時 | 2019-08-30 21:33:31 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 90 ms / 300 ms |
コード長 | 317 bytes |
コンパイル時間 | 325 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-06-29 06:15:37 |
合計ジャッジ時間 | 2,652 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
コンパイルメッセージ
Syntax OK
ソースコード
def lscan; gets.split.map(&:to_i); end h = {} h[[2,8]] = 1 h[[3,9]] = 2 h[[7,9]] = 3 cnt = 10 gets.to_i.times do a,b,c,d = lscan abort h.to_s if h[[c,d]] i = h[[a,b]] i ||= (cnt += 1) h[[a,b]] = nil h[[c,d]] = i end if h[[5,8]] == 1 && h[[4,8]] == 2 && h[[6,8]] == 3 puts 'YES' else puts 'NO' end