結果

問題 No.717 ファッションへのこだわり
ユーザー 👑 nu50218nu50218
提出日時 2018-08-23 20:54:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 638 bytes
コンパイル時間 1,561 ms
コンパイル使用メモリ 169,756 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-27 06:53:14
合計ジャッジ時間 2,464 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#define FOR(I,X,Y) for(int (I)=(X);(I)<(Y);(I)++)
#define REP(I,X,Y) for(int (I)=(Y)-1;(I)>=(X);(I)--)
#define ALL(X) (X).begin(),(X).end()
#define INF 1000000007
#define LINF 1000000000000000007
typedef long long ll;
using namespace std;

int main(){
  int N,M;
  cin >> N >> M;
  vector<char> S(N),T(M);
  FOR(i,0,N)cin >> S[i];
  FOR(i,0,M)cin >> T[i];
  sort(ALL(S));
  sort(ALL(T));
  cout << min(upper_bound(ALL(S),'A')-lower_bound(ALL(S),'A'),upper_bound(ALL(T),'A')-lower_bound(ALL(T),'A')) + min(upper_bound(ALL(S),'B')-lower_bound(ALL(S),'B'),upper_bound(ALL(T),'B')-lower_bound(ALL(T),'B')) << endl;
}
0