結果
| 問題 | No.2209 Flip and Reverse |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-17 16:48:46 |
| 言語 | Lua (LuaJit 2.1.1787165859) |
| 結果 |
AC
不安定
|
| 実行時間 | 76 ms / 2,000 ms |
| + 136µs | |
| コード長 | 327 bytes |
| 記録 | |
| コンパイル時間 | 66 ms |
| コンパイル使用メモリ | 6,272 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2026-08-29 20:39:18 |
| 合計ジャッジ時間 | 3,447 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
local n = io.read("*n", "*l")
local s = io.read()
local t = io.read()
local f = 0
for i = 1, n do
if s:sub(i, i) == "1" then f = f + 1 end
if t:sub(i, i) == "1" then f = f + 1 end
end
if f % 2 == 1 then
s = s:reverse()
end
local c = 0
for i = 1, n do
if s:sub(i, i) ~= t:sub(i, i) then
c = c + 1
end
end
print(c)