結果

問題 No.161 制限ジャンケン
ユーザー 👑 KazunKazun
提出日時 2020-10-25 04:01:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 77 ms / 5,000 ms
コード長 372 bytes
コンパイル時間 732 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 71,388 KB
最終ジャッジ日時 2023-09-28 22:10:48
合計ジャッジ時間 4,509 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,144 KB
testcase_01 AC 74 ms
71,012 KB
testcase_02 AC 73 ms
71,308 KB
testcase_03 AC 74 ms
71,240 KB
testcase_04 AC 75 ms
71,100 KB
testcase_05 AC 75 ms
71,240 KB
testcase_06 AC 73 ms
71,148 KB
testcase_07 AC 75 ms
71,236 KB
testcase_08 AC 74 ms
71,152 KB
testcase_09 AC 73 ms
71,280 KB
testcase_10 AC 74 ms
71,388 KB
testcase_11 AC 74 ms
71,200 KB
testcase_12 AC 77 ms
71,012 KB
testcase_13 AC 74 ms
71,296 KB
testcase_14 AC 74 ms
71,084 KB
testcase_15 AC 75 ms
71,324 KB
testcase_16 AC 75 ms
71,256 KB
testcase_17 AC 74 ms
71,252 KB
testcase_18 AC 75 ms
71,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

G,C,P=map(int,input().split())
S=input()

X=Y=Z=0
for s in S:
    if s=="G":
        X+=1
    elif s=="C":
        Y+=1
    else:
        Z+=1

Score=0

alpha=min(G,Y)
beta =min(C,Z)
gamma=min(P,X)
Score=3*(alpha+beta+gamma)

G-=alpha;Y-=alpha
C-=beta ;Z-=beta
P-=gamma;X-=gamma

alpha=min(G,X)
beta =min(C,Y)
gamma=min(P,Z)

Score+=alpha+beta+gamma

print(Score)
assert 1
0