結果
問題 | No.161 制限ジャンケン |
ユーザー |
![]() |
提出日時 | 2015-03-16 02:10:20 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 5,000 ms |
コード長 | 587 bytes |
コンパイル時間 | 239 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-11-30 04:31:05 |
合計ジャッジ時間 | 1,443 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 |
ソースコード
#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 C -= 1 if s == 'P' and P > 0 : ans += 1 P -= 1 print(ans)