結果
| 問題 | No.717 ファッションへのこだわり | 
| コンテスト | |
| ユーザー |  kekenx | 
| 提出日時 | 2020-01-31 18:23:58 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 3 ms / 2,000 ms | 
| コード長 | 471 bytes | 
| コンパイル時間 | 1,496 ms | 
| コンパイル使用メモリ | 166,316 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-09-17 06:55:16 | 
| 合計ジャッジ時間 | 2,280 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 10 | 
ソースコード
#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 scnta = 0;
  int scntb = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == 'A') scnta++;
    else scntb++;
  }
  int tcnta = 0;
  int tcntb = 0;
  for (int i = 0; i < m; ++i) {
    if (t[i] == 'A') tcnta++;
    else tcntb++;
  }
  int ans = min(scnta, tcnta) + min(scntb, tcntb);
  cout << ans << endl;
  return 0;
}
            
            
            
        