結果

問題 No.2920 Blood Type
コンテスト
ユーザー norioc
提出日時 2025-02-05 01:56:30
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 394 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 342 ms
コンパイル使用メモリ 85,120 KB
実行使用メモリ 52,224 KB
最終ジャッジ日時 2026-06-27 09:13:12
合計ジャッジ時間 3,228 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

S = input()
T = input()


def f(a, b):
    s = {a, b}
    if 'A' in s and 'B' in s:
        return 'AB'
    if 'A' in s:
        return 'A'
    if 'B' in s:
        return 'B'
    return 'O'


res = {'A': 0, 'B': 0, 'AB': 0, 'O': 0}
for c1 in S:
    for c2 in T:
        res[f(c1, c2)] += 1

ans = []
for a in ['A', 'B', 'AB', 'O']:
    x = res[a] / 4 * 100
    ans.append(int(x))

print(*ans)
0