結果

問題 No.717 ファッションへのこだわり
ユーザー yansi819
提出日時 2024-03-30 12:59:13
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 403 bytes
コンパイル時間 4,337 ms
コンパイル使用メモリ 257,740 KB
最終ジャッジ日時 2025-02-20 15:52:39
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;

ll N, M;
string S, T;
map<char, ll> mpS, mpT;

int main() {
  cin >> N >> M;
  cin >> S >> T;
  for (int i = 0; i < N; i++) mpS[S[i]]++;
  for (int i = 0; i < M; i++) mpT[T[i]]++;
  cout << min(mpS['A'], mpT['A']) + min(mpS['B'], mpT['B']) << endl;
  return 0;
}
0