結果

問題 No.717 ファッションへのこだわり
ユーザー a01sa01to
提出日時 2024-09-18 00:24:46
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 486 bytes
コンパイル時間 2,757 ms
コンパイル使用メモリ 244,596 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-18 00:24:50
合計ジャッジ時間 3,696 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
  #include "settings/debug.cpp"
#else
  #define Debug(...) void(0)
#endif
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;

int main() {
  int n, m;
  string s, t;
  cin >> n >> m >> s >> t;
  int a1 = 0, a2 = 0, b1 = 0, b2 = 0;
  for (char c : s) (c == 'A' ? a1 : a2)++;
  for (char c : t) (c == 'A' ? b1 : b2)++;
  cout << min(a1, b1) + min(a2, b2) << endl;
  return 0;
}
0