結果

問題 No.717 ファッションへのこだわり
ユーザー MA_yo_TA
提出日時 2018-08-02 13:36:09
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 414 bytes
コンパイル時間 223 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-19 17:06:43
合計ジャッジ時間 1,109 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
s = list(input())
t = list(input())
top_a = 0
top_b = 0
botom_a = 0
botom_b = 0
for i in s:
    if i == "A":
        top_a += 1
    elif i == "B":
        top_b += 1
for i in t:
    if i == "A":
        botom_a += 1
    elif i == "B":
        botom_b += 1
if top_a > botom_a:
    a = botom_a
else:
    a = top_a
if top_b > botom_b:
    b = botom_b
else:
    b = top_b
print(a + b)
0