結果

問題 No.161 制限ジャンケン
ユーザー akitsugu777akitsugu777
提出日時 2019-08-15 13:38:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 31 ms / 5,000 ms
コード長 282 bytes
コンパイル時間 79 ms
コンパイル使用メモリ 11,816 KB
実行使用メモリ 10,028 KB
最終ジャッジ日時 2023-10-19 19:00:26
合計ジャッジ時間 1,488 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,028 KB
testcase_01 AC 30 ms
10,028 KB
testcase_02 AC 29 ms
10,028 KB
testcase_03 AC 28 ms
10,028 KB
testcase_04 AC 29 ms
10,028 KB
testcase_05 AC 29 ms
10,028 KB
testcase_06 AC 29 ms
10,028 KB
testcase_07 AC 29 ms
10,028 KB
testcase_08 AC 28 ms
10,028 KB
testcase_09 AC 29 ms
10,028 KB
testcase_10 AC 29 ms
10,028 KB
testcase_11 AC 29 ms
10,028 KB
testcase_12 AC 29 ms
10,028 KB
testcase_13 AC 29 ms
10,028 KB
testcase_14 AC 31 ms
10,028 KB
testcase_15 AC 28 ms
10,028 KB
testcase_16 AC 29 ms
10,028 KB
testcase_17 AC 29 ms
10,028 KB
testcase_18 AC 29 ms
10,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

g1, c1, p1 = map(int,input().split())
s = input()

g2 = s.count('G')
c2 = s.count('C')
p2 = s.count('P')

a = min(g1, c2)
g1 -= a
c2 -= a
b = min(c1, p2)
c1 -= b
p2 -= b
c = min(p1, g2)
p1 -= c
g2 -= c

d = min(g1, g2)
e = min(c1, c2)
f = min(p1, p2)

print(3 * (a+b+c) + d + e + f)
0