結果

問題 No.2920 Blood Type
コンテスト
ユーザー Polaris2124
提出日時 2024-10-12 15:04:32
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 852 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,279 ms
コンパイル使用メモリ 84,480 KB
実行使用メモリ 61,184 KB
最終ジャッジ日時 2026-04-29 15:58:30
合計ジャッジ時間 3,550 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
import math
from itertools import product, permutations, combinations, accumulate
from heapq import heapify, heappush, heappop
from collections import deque, defaultdict, Counter
from bisect import bisect, bisect_left, bisect_right
from copy import copy, deepcopy
#from sortedcontainers import SortedSet, SortedList, SortedDict

sys.setrecursionlimit(10**7)
INF = float('inf')
LINF = 1 << 60
MOD = 10**9+7

def mii():
    return map(int, sys.stdin.readline().split())

S = input()
T = input()

ans = [0]*4

for u, v in product(list(S), list(T)):
    s = [u, v]
    if "A" in s and "B" not in s:
        ans[0] += 1
    elif "B" in s and "A" not in s:
        ans[1] += 1
    elif "A" in s and "B" in s:
        ans[2] += 1
    else:
        ans[3] += 1

su = sum(ans)
a = []
for i in range(4):
    a.append(int(ans[i] / su * 100))

print(*a)
0