結果

問題 No.2920 Blood Type
ユーザー GOTKAKO
提出日時 2024-10-12 14:32:57
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 553 bytes
コンパイル時間 2,096 ms
コンパイル使用メモリ 199,832 KB
最終ジャッジ日時 2025-02-24 17:34:18
ジャッジサーバーID
(参考情報)
judge5 / judge
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    string s,t; cin >> s >> t;
    vector<int> answer(4);
    for(auto c : s) for(auto c2 : t){
        set<char> S = {c,c2};
        if(S.count('A') && !S.count('B')) answer.at(0) += 25;
        else if(S.count('B') && !S.count('A')) answer.at(1) += 25;
        else if(S.count('A') && S.count('B')) answer.at(2) += 25;
        else answer.at(3) += 25;
    }

    for(int i=0; i<4; i++) cout << answer.at(i) << (i==3?"\n":" ");
}

0