結果

問題 No.717 ファッションへのこだわり
ユーザー aaaaaaiu
提出日時 2019-08-01 00:41:40
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 392 bytes
コンパイル時間 2,170 ms
コンパイル使用メモリ 193,944 KB
最終ジャッジ日時 2025-01-07 10:23:27
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int n, m;
    cin>>n>>m;
    string s, t;
    cin>>s>>t;
    int sa, sb, ta, tb;
    sa=sb=ta=tb=0;
    for (char c:s) {
        if (c=='A') sa++;
        else sb++;
    }
    for (char c:t) {
        if (c=='A') ta++;
        else tb++;
    }
    cout << min(sa, ta) + min(sb, tb) << endl;
    return 0;
}
0