結果
問題 |
No.717 ファッションへのこだわり
|
ユーザー |
|
提出日時 | 2018-08-23 20:54:06 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 638 bytes |
コンパイル時間 | 4,197 ms |
コンパイル使用メモリ | 171,192 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-26 18:19:36 |
合計ジャッジ時間 | 2,639 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#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; }