結果

問題 No.717 ファッションへのこだわり
ユーザー TqkTqk
提出日時 2018-07-28 14:31:02
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,333 bytes
コンパイル時間 1,507 ms
コンパイル使用メモリ 143,308 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-19 06:11:35
合計ジャッジ時間 2,062 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,384 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
#define repi(i,a,b) for(int i=(a), i##_len=(b); i<i##_len; ++i)
#define rep(i,n) repi(i,0,n)
#define all(x) (x).begin(),(x).end()
#define tsort(v) sort((v).begin(), (v).end())
#define trev(v) tsort(v); reverse((v).begin(), (v).end())
#define siz(v) ((int)(v).size())
#define ers(v, n) (v).erase((v).begin() + n)
#define vmin(v) *min_element(v.begin(), v.end())
#define vmax(v) *max_element(v.begin(), v.end())
#define el "\n"
#define co(x) cout<<(x)<<el
#define coc(c, a, b) if(c)co((a));else co((b))
#define YES(c) coc(c,"YES", "NO")
#define Yes(c) coc(c,"Yes", "No")
#define yes(c) coc(c,"yes", "no")
#ifdef tqktmp_2
#define gc() getchar(); getchar()
#else
#define gc() 1
#endif
typedef long long lint;

lint dx[8] = { 0,1,1,1,0,-1,-1,-1 },
     dy[8] = { 1,1,0,-1,-1,-1,0,1 };

template<class T>bool maxi(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool mini(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }

int main(){
cin.tie(0);
ios::sync_with_stdio(0);
    lint n,m,ctr[4]={};char in;
    cin>>n>>m;
    rep(i,n){
        cin>>in;
        if(in=='A')ctr[0]++;
        else ctr[1]++;
    }
    
    rep(i,m){
        cin>>in;
        if(in=='A')ctr[2]++;
        else ctr[3]++;
    }
    co(min(ctr[0],ctr[2])+min(ctr[1],ctr[3]));
}
0