結果

問題 No.2920 Blood Type
コンテスト
ユーザー Hydrogen332
提出日時 2024-10-28 23:22:22
言語 C++17
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 0 ms / 2,000 ms
コード長 659 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,096 ms
コンパイル使用メモリ 219,504 KB
実行使用メモリ 9,232 KB
最終ジャッジ日時 2026-07-06 02:36:58
合計ジャッジ時間 3,041 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, e) for (int i = (int)s; i < (int)e; ++i)
#define all(a) (a).begin(), (a).end()

int main() {
    cin.tie(nullptr);
    
    string S, T;
    cin >> S >> T;
    
    int a = 0, b = 0, ab = 0, o = 0;
    
    rep(i, 0, 2) rep(j, 0, 2) {
        set<char> s;
        s.insert(S[i]);
        s.insert(T[j]);
        
        if (s.count('A') && s.count('B')) ab++;
        else if (s.count('A')) a++;
        else if (s.count('B')) b++;
        else o++;
    }
    
    cout << a * 25 << ' ';
    cout << b * 25 << ' ';
    cout << ab * 25 << ' ';
    cout << o * 25 << '\n';
}
0