結果

問題 No.161 制限ジャンケン
ユーザー noko2250noko2250
提出日時 2015-03-16 02:09:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 587 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 10,892 KB
実行使用メモリ 7,956 KB
最終ジャッジ日時 2023-09-11 08:27:48
合計ジャッジ時間 1,489 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,740 KB
testcase_01 AC 15 ms
7,784 KB
testcase_02 AC 15 ms
7,848 KB
testcase_03 AC 15 ms
7,724 KB
testcase_04 AC 16 ms
7,828 KB
testcase_05 AC 15 ms
7,932 KB
testcase_06 AC 15 ms
7,800 KB
testcase_07 AC 16 ms
7,800 KB
testcase_08 AC 16 ms
7,876 KB
testcase_09 AC 16 ms
7,812 KB
testcase_10 AC 15 ms
7,736 KB
testcase_11 AC 16 ms
7,808 KB
testcase_12 AC 15 ms
7,956 KB
testcase_13 AC 15 ms
7,936 KB
testcase_14 WA -
testcase_15 AC 16 ms
7,824 KB
testcase_16 AC 15 ms
7,828 KB
testcase_17 AC 15 ms
7,812 KB
testcase_18 AC 16 ms
7,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#Created on 2015/03/16

[G, C, P] = map(int, input().split())
S = list(input())
ans = 0
for i in range(len(S)) :
    if S[i] == 'G' and P > 0 : 
        ans += 3
        P -= 1
        S[i] = ''
    if S[i] == 'C' and G > 0 : 
        ans += 3
        G -= 1
        S[i] = ''
    if S[i] == 'P' and C > 0 : 
        ans += 3
        C -= 1 
        S[i] = ''
        
for s in S :
    if s == 'G' and G > 0 : 
        ans += 1
        G -= 1
    if s == 'C' and C > 0 : 
        ans += 1
        G -= 1
    if s == 'P' and P > 0 : 
        ans += 1
        P -= 1
        
print(ans)   
0