結果
| 問題 | No.2920 Blood Type | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2024-10-12 14:37:02 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 43 ms / 2,000 ms | 
| コード長 | 743 bytes | 
| コンパイル時間 | 192 ms | 
| コンパイル使用メモリ | 82,436 KB | 
| 実行使用メモリ | 55,508 KB | 
| 最終ジャッジ日時 | 2024-10-12 14:37:05 | 
| 合計ジャッジ時間 | 2,618 ms | 
| ジャッジサーバーID (参考情報) | judge / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 36 | 
ソースコード
from collections import defaultdict
import sys
input = sys.stdin.readline
S = input().strip()
T = input().strip()
D = defaultdict(int)
for s in S:
    for t in T:
        tmp = {s, t}
        if "A" in tmp and "B" in tmp:
            if "AB" not in D:
                D["AB"] = 25
            else:
                D["AB"] += 25
        elif "A" in tmp:
            if "A" not in D:
                D["A"] = 25
            else:
                D["A"] += 25
        elif "B" in tmp:
            if "B" not in D:
                D["B"] = 25
            else:
                D["B"] += 25
        else:
            if "O" not in D:
                D["O"] = 25
            else:
                D["O"] += 25
print(D["A"], D["B"], D["AB"], D["O"])
            
            
            
        