結果
| 問題 | No.870 無敵囲い | 
| コンテスト | |
| ユーザー | 👑 | 
| 提出日時 | 2019-08-30 21:27:37 | 
| 言語 | Lua (LuaJit 2.1.1734355927) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 300 ms | 
| コード長 | 430 bytes | 
| コンパイル時間 | 369 ms | 
| コンパイル使用メモリ | 5,504 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-29 06:14:06 | 
| 合計ジャッジ時間 | 1,115 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 18 | 
ソースコード
local n = io.read("*n")
local t = {}
for i = 1, n do
  local a, b = io.read("*n", "*n")
  local c, d = io.read("*n", "*n")
  local i1 = (a - 1) * 9 + b
  local i2 = (c - 1) * 9 + d
  local found = false
  for k, v in pairs(t) do
    if v == i1 then
      found = true
      t[k] = i2
      break
    end
  end
  if not found then t[i1] = i2 end
end
local r = t[17] == 44 and t[27] == 35 and t[63] == 53
print(r and "YES" or "NO")
            
            
            
        