結果

問題 No.2920 Blood Type
ユーザー yuu_w
提出日時 2024-10-13 09:24:59
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,732 bytes
コンパイル時間 2,076 ms
コンパイル使用メモリ 197,208 KB
最終ジャッジ日時 2025-02-24 19:10:33
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#define debug(x) cerr << #x << " = " << (x) << endl
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define mp make_pair
#define pb push_back
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;

struct IOSetup
{
	IOSetup()
	{
		cin.tie(nullptr)->sync_with_stdio(false);
		cout << fixed << setprecision(16);
		cerr << fixed << setprecision(16);
	}
} iosetup;

template <typename T1, typename T2>
ostream &operator <<(ostream &os, const pair<T1, T2> &p)
{
	os << p.first << " " << p.second;
	return os;
}

template <typename T1, typename T2>
istream &operator >>(istream &is, pair<T1, T2> &p)
{
	is >> p.first >> p.second;
	return is;
}

template <typename T>
ostream &operator <<(ostream &os, const vector<T> &v)
{
	for(int i = 0; i < (int) v.size(); i++) os << v[i] << (i+1 == (int) v.size() ? "" : " ");
	return os;
}

template <typename T>
istream &operator >>(istream &is, vector<T> &v)
{
	for(int i = 0; i < (int) v.size(); i++) is >> v[i];
	return is;
}

template <typename T> bool chmax(T &a, const T &b) { if(a < b) { a = b; return true; } return false; }
template <typename T> bool chmin(T &a, const T &b) { if(a > b) { a = b; return true; } return false; }

////////////////////////////////////////////////////////

int main()
{
	string S, T; cin >> S >> T;
	int a = 0, b = 0, ab = 0, o = 0;
	for(char c : S)for(char d : T)
	{
		string tmp = "";
		tmp += c;
		tmp += d;
		sort(all(tmp));
		if(tmp == "AA" || tmp == "AO") a += 25;
		else if(tmp == "BB" || tmp == "BO") b += 25;
		else if(tmp == "AB") ab += 25;
		else o += 25;
	}
	cout << a << " " << b << " " << ab << " " << o << endl;
	return 0;
}
0