結果

問題 No.2920 Blood Type
ユーザー forest3
提出日時 2025-01-16 17:10:38
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 598 bytes
コンパイル時間 1,345 ms
コンパイル使用メモリ 161,504 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2025-01-16 17:10:42
合計ジャッジ時間 3,018 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) for( ll i = 0; i < n; i++ )
using ll = long long;

int main() {
	string s, t;
	cin >> s >> t;
	int a = 0, b = 0, ab = 0, o = 0;
	rep(i, 2) rep(j, 2) {
		char c1 = s[i];
		char c2 = t[j];
		if(c1 == 'A') {
			if(c2 == 'A' || c2 == 'O') a++;
			else if(c2 == 'B') ab++;
		}
		else if(c1 == 'B') {
			if(c2 == 'B' || c2 == 'O') b++;
			else if(c2 == 'A') ab++;
		}
		else {
			if(c2 == 'O') o++;
			else if(c2 == 'A') a++;
			else if(c2 == 'B') b++;
		}
	}
	cout << a * 25 << " " << b * 25 << " " << ab * 25 << " " << o * 25 << endl;
}
0