結果

問題 No.2920 Blood Type
ユーザー ktsn-ud
提出日時 2024-10-12 14:40:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 589 bytes
コンパイル時間 235 ms
コンパイル使用メモリ 82,460 KB
実行使用メモリ 53,916 KB
最終ジャッジ日時 2024-10-12 14:40:34
合計ジャッジ時間 2,778 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin


def main():
    s = stdin.readline().rstrip()
    t = stdin.readline().rstrip()

    a = 0
    b = 0
    ab = 0
    o = 0

    for i in range(2):
        for j in range(2):
            bloods = {s[i], t[j]}
            if 'A' in bloods and 'B' in bloods:
                ab += 1
            elif 'A' in bloods:
                a += 1
            elif 'B' in bloods:
                b += 1
            else:
                o += 1
    ans = [a, b, ab, o]
    ans = [ans[i]*100//4 for i in range(4)]
    print(*ans)
    return


if __name__ == "__main__":
    main()
0