結果
問題 | No.717 ファッションへのこだわり |
ユーザー | xuelei |
提出日時 | 2018-07-27 22:41:08 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 369 bytes |
コンパイル時間 | 489 ms |
コンパイル使用メモリ | 62,484 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-05 02:52:04 |
合計ジャッジ時間 | 1,096 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include <iostream> #include <algorithm> #include <cmath> using namespace std; int main(){ int n,m; cin >> n >> m; string a,b; cin >> a >> b; int a1=count(a.begin(),a.end(),'A'); int a2=count(a.begin(),a.end(),'B'); int b1=count(b.begin(),b.end(),'A'); int b2=count(b.begin(),b.end(),'B'); cout << (a1<b1?a1:b1)+(a2<b2?a2:b2) << endl; return 0; }