結果
問題 | 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 = 0for i in range(len(S)) :if S[i] == 'G' and P > 0 :ans += 3P -= 1S[i] = ''if S[i] == 'C' and G > 0 :ans += 3G -= 1S[i] = ''if S[i] == 'P' and C > 0 :ans += 3C -= 1S[i] = ''for s in S :if s == 'G' and G > 0 :ans += 1G -= 1if s == 'C' and C > 0 :ans += 1C -= 1if s == 'P' and P > 0 :ans += 1P -= 1print(ans)