結果

問題 No.161 制限ジャンケン
ユーザー nohakai3nohakai3
提出日時 2022-11-07 21:04:46
言語 PyPy3
(7.3.13)
結果
WA  
実行時間 -
コード長 385 bytes
コンパイル時間 916 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 79,112 KB
最終ジャッジ日時 2023-09-28 09:30:13
合計ジャッジ時間 3,026 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 62 ms
71,552 KB
testcase_02 AC 64 ms
71,524 KB
testcase_03 AC 64 ms
71,104 KB
testcase_04 RE -
testcase_05 AC 62 ms
71,340 KB
testcase_06 AC 62 ms
71,232 KB
testcase_07 AC 62 ms
71,544 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 RE -
testcase_11 AC 62 ms
71,232 KB
testcase_12 RE -
testcase_13 WA -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

g,c,p=map(int,input().split())
s=list(input())
g2,c2,p2=0,0,0
for x in s:
    if x=="G":
        g2+=1
    elif x=="C":
        c2+=1
    else:
        p2+=1

l=[g2,c2,p2]
ans=0
ans+=3*min(g,c2)
ans+=3*min(c,p2)
ans+=3*min(p,g2)
g-=min(g,c2)
c-=min(c,p2)
p-=min(p,g2)
if g>0 and g2>0:
    ans+=min(g,g2)
elif c>0 and c2>0:
    ans+=(c,c2)
elif p>0 and p2>0:
    ans+=(p,p2)

print(ans)
0