結果
問題 |
No.1183 コイン遊び
|
ユーザー |
👑 |
提出日時 | 2020-09-19 20:12:47 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
AC
|
実行時間 | 445 ms / 2,000 ms |
コード長 | 335 bytes |
コンパイル時間 | 109 ms |
コンパイル使用メモリ | 7,072 KB |
実行使用メモリ | 27,232 KB |
最終ジャッジ日時 | 2024-06-23 18:16:05 |
合計ジャッジ時間 | 12,224 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 |
ソースコード
local n = io.read("*n") local a = {} local b = {} for i = 1, n do a[i] = io.read("*n") end for i = 1, n do b[i] = io.read("*n") end local t = {0} for i = 1, n do if a[i] == b[i] then table.insert(t, i) end end table.insert(t, n + 1) c = 0 for i = 1, #t - 1 do if 1 < t[i + 1] - t[i] then c = c + 1 end end print(c)