結果

問題 No.2920 Blood Type
ユーザー kyotoku1483
提出日時 2025-03-13 21:47:16
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 709 bytes
コンパイル時間 366 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 10,368 KB
最終ジャッジ日時 2025-03-13 21:47:20
合計ジャッジ時間 3,101 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    s = input()
    t = input()
    b = {'A': 0, 'B': 0, 'AB': 0, 'O': 0}
    for x in s:
        for y in t:
            st = {x, y}
            flg = False
            if 'A' in st and 'B' not in st:
                b['A'] += 1
                flg = True
            if 'B' in st and 'A' not in st:
                b['B'] += 1
                flg = True
            if 'A' in st and 'B' in st:
                b['AB'] += 1
                flg = True
            if not flg:
                b['O'] += 1
    d = 0
    for k in b:
        d += b[k]
    print(f'{b['A'] * 100 // d} {b['B'] * 100 // d}'
          f' {b['AB'] * 100 // d} {b['O'] * 100 // d}')


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