結果

問題 No.161 制限ジャンケン
ユーザー roarisroaris
提出日時 2019-12-21 16:10:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 5,000 ms
コード長 275 bytes
コンパイル時間 822 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 71,516 KB
最終ジャッジ日時 2023-09-26 22:05:10
合計ジャッジ時間 3,425 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,516 KB
testcase_01 AC 70 ms
71,276 KB
testcase_02 AC 71 ms
71,408 KB
testcase_03 AC 71 ms
71,408 KB
testcase_04 AC 68 ms
71,232 KB
testcase_05 AC 69 ms
71,136 KB
testcase_06 AC 69 ms
71,248 KB
testcase_07 AC 68 ms
71,224 KB
testcase_08 AC 69 ms
71,248 KB
testcase_09 AC 69 ms
71,516 KB
testcase_10 AC 67 ms
71,316 KB
testcase_11 AC 71 ms
71,388 KB
testcase_12 AC 69 ms
71,220 KB
testcase_13 AC 75 ms
71,064 KB
testcase_14 AC 76 ms
71,136 KB
testcase_15 AC 68 ms
71,216 KB
testcase_16 AC 69 ms
71,324 KB
testcase_17 AC 69 ms
71,328 KB
testcase_18 AC 71 ms
71,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

G, C, P = map(int, input().split())
S = input()
G2, C2, P2 = S.count('G'), S.count('C'), S.count('P')
ans = 3*min(G, C2)+3*min(C, P2)+3*min(P, G2)
ans += min(max(0, G2-P), max(0, G-C2))
ans += min(max(0, C2-G), max(0, C-P2))
ans += min(max(0, P2-C), max(0, P-G2))

print(ans)
0