結果

問題 No.717 ファッションへのこだわり
ユーザー clearbookclearbook
提出日時 2019-11-09 16:49:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 20 ms / 2,000 ms
コード長 310 bytes
コンパイル時間 512 ms
コンパイル使用メモリ 10,736 KB
実行使用メモリ 7,936 KB
最終ジャッジ日時 2023-10-13 07:20:19
合計ジャッジ時間 1,234 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,836 KB
testcase_01 AC 16 ms
7,936 KB
testcase_02 AC 16 ms
7,880 KB
testcase_03 AC 16 ms
7,792 KB
testcase_04 AC 14 ms
7,868 KB
testcase_05 AC 15 ms
7,912 KB
testcase_06 AC 15 ms
7,876 KB
testcase_07 AC 18 ms
7,808 KB
testcase_08 AC 20 ms
7,836 KB
testcase_09 AC 20 ms
7,832 KB
testcase_10 AC 18 ms
7,836 KB
testcase_11 AC 17 ms
7,844 KB
testcase_12 AC 17 ms
7,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
S = input()
T = input()

S_A = 0
S_B = 0
for i in range(N):
    if S[i] == "A":
        S_A += 1
    else:
        S_B += 1
        
T_A = 0
T_B = 0
for i in range(M):
    if T[i] == "A":
        T_A += 1
    else:
        T_B += 1
        
print(min(S_A, T_A) + min(S_B, T_B))
0