結果
問題 | No.717 ファッションへのこだわり |
ユーザー |
![]() |
提出日時 | 2018-07-27 23:10:20 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 427 bytes |
コンパイル時間 | 1,466 ms |
コンパイル使用メモリ | 166,456 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-05 04:45:42 |
合計ジャッジ時間 | 2,086 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include <bits/stdc++.h>#define rep(i, a, n) for(int i = a; i < n; i++)#define int long longusing namespace std;typedef pair<int, int> P;const int INF = 1e15;signed main(){int n, m;cin >> n >> m;string s, t;cin >> s >> t;int as = 0, at = 0;rep(i, 0, n) if(s[i] == 'A') as++;rep(i, 0, m) if(t[i] == 'A') at++;int ans = min(as, at) + min(n - as, m - at);cout << ans << endl;}