結果
問題 | No.2920 Blood Type |
ユーザー |
![]() |
提出日時 | 2025-01-31 23:03:09 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 77 ms / 2,000 ms |
コード長 | 949 bytes |
コンパイル時間 | 211 ms |
コンパイル使用メモリ | 12,160 KB |
実行使用メモリ | 13,440 KB |
最終ジャッジ日時 | 2025-01-31 23:03:14 |
合計ジャッジ時間 | 5,016 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 36 |
ソースコード
from collections import *from itertools import *from functools import cache, partialfrom pprint import pprintimport sysfrom typing import Any, Finaltry:from icecream import icexcept ImportError: # Graceful fallback if IceCream isn't installed.ic = lambda *a: None if not a else (a[0] if len(a) == 1 else a) # noqadebug = partial(print, file=sys.stderr)dpprint = partial(pprint, stream=sys.stderr)sys.setrecursionlimit(10**6)MOD = 998244353S = input()T = input()counts = defaultdict(int)for s in S:for t in T:ic(s, t)blood_type = "".join(sorted([s, t]))ic(blood_type)if blood_type == "AB":counts["AB"] += 1elif "A" in blood_type:counts["A"] += 1elif "B" in blood_type:counts["B"] += 1else:counts["O"] += 1ic(counts)print(counts["A"] * 25, counts["B"] * 25, counts["AB"] * 25, counts["O"] * 25)