結果

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

ソースコード

diff #

#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
using namespace std;


int main()
{
    int n, m, ans;
    cin >> n >> m;
    vector<int> up(2, 0), down(2, 0);
    string s, t;
    cin >> s >> t;
    for (int i = 0; i < s.size(); i++){
        if (s[i] == 'A') up[0]++;
        else up[1]++;
    }
    for (int i = 0; i < t.size(); i++){
        if(t[i] == 'A') down[0]++;
        else down[1]++;
    }
    cout << min(up[0], down[0]) + min(up[1], down[1]) << endl;
}
0