結果

問題 No.717 ファッションへのこだわり
ユーザー xxxasdfghjk
提出日時 2018-09-07 10:38:56
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 517 bytes
コンパイル時間 1,326 ms
コンパイル使用メモリ 158,696 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-26 07:59:51
合計ジャッジ時間 2,173 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define MAX_N 100001
#define INF_INT 2147483647
#define INF_LL 9223372036854775807
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;

int main()
{
  int N,M,sgara=0,smuji=0,tgara=0,tmuji=0;
  string S,T;
  cin >> N >> M;
  cin >> S;
  cin >> T;
  REP(i,S.size())if(S[i] == 'A')smuji++;else sgara++;
  REP(i,T.size())if(T[i] == 'A')tmuji++;else tgara++;
  cout << (min(sgara,tgara)+min(smuji,tmuji)) << endl;
    
  return 0;
}

0