結果
問題 | No.717 ファッションへのこだわり |
ユーザー |
![]() |
提出日時 | 2018-07-27 23:35:51 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 578 bytes |
コンパイル時間 | 677 ms |
コンパイル使用メモリ | 73,948 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-05 05:33:19 |
合計ジャッジ時間 | 1,255 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include <cstdio> #include <cstring> #include <iostream> #include <string> #include <cmath> #include <bitset> #include <vector> #include <map> #include <set> #include <queue> #include <deque> #include <algorithm> #define MOD 1000000007LL using namespace std; typedef long long int ll; typedef pair<ll, ll> P; int main() { int n, m; cin>>n>>m; string s, t; cin>>s>>t; int a1=0, a2=0, b1=0, b2=0; for(int i=0; i<n; i++){ if(s[i]=='A') a1++; else b1++; } for(int i=0; i<m; i++){ if(t[i]=='A') a2++; else b2++; } cout<<min(a1, a2)+min(b1, b2)<<endl; return 0; }