結果

問題 No.717 ファッションへのこだわり
ユーザー dazydazy
提出日時 2018-07-30 19:55:42
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 552 bytes
コンパイル時間 1,415 ms
コンパイル使用メモリ 164,600 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-12 11:10:13
合計ジャッジ時間 2,100 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,352 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,352 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
4,348 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
#define fastcin {\
    cin.tie(0);\
    ios::sync_with_stdio(false);\
}
#define rep(i, a, b) for(int i = a; i < b; i++)
#define print(x) cout << x << "\n"

int main() {
    fastcin;
    int n, m;
    string s, t;
    cin >> n >> m >> s >> t;
    int ta = 0, tb = 0;
    rep(i, 0, n) {
        if(s[i]=='A') ta++;
        else tb++;
    }
    int ba = 0, bb = 0;
    rep(i, 0, m) {
        if(t[i]=='A') ba++;
        else bb++;
    }
    int ans = min(ta, ba) + min(ba, bb);
    print(ans);
    return 0;
}
0