結果
問題 | No.717 ファッションへのこだわり |
ユーザー |
|
提出日時 | 2018-07-27 22:26:52 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 385 bytes |
コンパイル時間 | 1,536 ms |
コンパイル使用メモリ | 166,664 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-05 01:26:18 |
合計ジャッジ時間 | 2,107 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define ll long long#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)int main() {ll n,m;cin>>n>>m;string s,t;cin>>s>>t;ll sa=0,sb=0,ta=0,tb=0;for(auto &ch : s) {if(ch=='A')sa++;if(ch=='B')sb++;}for(auto &ch : t) {if(ch=='A')ta++;if(ch=='B')tb++;}cout<<min(sa,ta)+min(sb,tb)<<endl;return 0;}