結果
問題 | No.2209 Flip and Reverse |
ユーザー |
👑 |
提出日時 | 2023-07-17 16:48:46 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
AC
|
実行時間 | 79 ms / 2,000 ms |
コード長 | 327 bytes |
コンパイル時間 | 148 ms |
コンパイル使用メモリ | 6,944 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-17 21:30:07 |
合計ジャッジ時間 | 4,037 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 |
ソースコード
local n = io.read("*n", "*l")local s = io.read()local t = io.read()local f = 0for i = 1, n doif s:sub(i, i) == "1" then f = f + 1 endif t:sub(i, i) == "1" then f = f + 1 endendif f % 2 == 1 thens = s:reverse()endlocal c = 0for i = 1, n doif s:sub(i, i) ~= t:sub(i, i) thenc = c + 1endendprint(c)