結果
| 問題 |
No.2209 Flip and Reverse
|
| コンテスト | |
| ユーザー |
minato
|
| 提出日時 | 2023-03-09 13:52:35 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 239 ms / 2,000 ms |
| コード長 | 287 bytes |
| コンパイル時間 | 198 ms |
| コンパイル使用メモリ | 82,528 KB |
| 実行使用メモリ | 172,120 KB |
| 最終ジャッジ日時 | 2024-09-18 02:53:28 |
| 合計ジャッジ時間 | 6,727 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
N = int(input())
S = list(input())
T = list(input())
cnts = cntt = 0
for c in S:
if c == "1":
cnts += 1
for c in T:
if c == "1":
cntt += 1
if abs(cnts - cntt) % 2 == 1:
S.reverse()
ans = 0
for i in range(N):
if S[i] != T[i]:
ans += 1
print(ans)
minato