結果
| 問題 | No.717 ファッションへのこだわり |
| コンテスト | |
| ユーザー |
d_sei
|
| 提出日時 | 2019-09-08 08:40:37 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 549 bytes |
| 記録 | |
| コンパイル時間 | 765 ms |
| コンパイル使用メモリ | 81,856 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-27 14:51:48 |
| 合計ジャッジ時間 | 1,438 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
ソースコード
#include<iostream>
#include<algorithm>
#include <vector>
#include<cmath>
#include<iomanip>
#include<queue>
using namespace std;
typedef long long int lint;
int main() {
int N, M;
string S, T;
cin >> N >> M >> S >> T;
int sa = 0;
int sb = 0;
int ta = 0;
int tb = 0;
for (int ia = 0; ia < N; ia++) {
if (S.at(ia) == 'A') {
sa++;
}
if (S.at(ia) == 'B') {
sb++;
}
}
for (int ib = 0; ib < M; ib++) {
if (T.at(ib) == 'A') {
ta++;
}
if (T.at(ib) == 'B') {
tb++;
}
}
cout << min(sa, ta) + min(sb, tb) << endl;
}
d_sei