結果
問題 | No.161 制限ジャンケン |
ユーザー |
![]() |
提出日時 | 2016-02-23 21:22:14 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 5,000 ms |
コード長 | 519 bytes |
コンパイル時間 | 83 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-11-30 04:49:42 |
合計ジャッジ時間 | 1,227 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 |
ソースコード
#!/usr/bin/env python3G, C, P = list(map(int,input().split()))S = input()eG = 0eC = 0eP = 0ans = 0for c in S:if c == 'G' :if P > 0 :ans += 3P -= 1else :eG += 1if c == 'C' :if G > 0 :ans += 3G -= 1else :eC += 1if c == 'P' :if C > 0 :ans += 3C -= 1else :eP += 1ans += min(eG, G)ans += min(eC, C)ans += min(eP, P)print(ans)