結果
問題 |
No.717 ファッションへのこだわり
|
ユーザー |
![]() |
提出日時 | 2018-08-12 17:34:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 658 bytes |
コンパイル時間 | 695 ms |
コンパイル使用メモリ | 79,720 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-24 07:28:51 |
合計ジャッジ時間 | 1,206 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <stack> #include <map> #include <queue> #include <numeric> #include <climits> #include <iterator> #include <bitset> #include <functional> using namespace std; const constexpr int INF = 1e9; long long N, M; int y, m, d; string S, T; void solve(){ int sa=0, sb=0, ta=0, tb=0; for(int i=0; i<S.size(); ++i){ if(S[i]=='A') sa++; else sb++; } for(int i=0; i<T.size(); ++i){ if(T[i]=='A') ta++; else tb++; } cout << min(sa, ta) + min(sb, tb) << endl; } int main() { cin >> N >> M >> S >> T; solve(); return 0; }