結果
問題 | No.161 制限ジャンケン |
ユーザー |
![]() |
提出日時 | 2021-03-16 22:18:08 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 5,000 ms |
コード長 | 505 bytes |
コンパイル時間 | 548 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-11-08 17:33:21 |
合計ジャッジ時間 | 1,683 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 |
ソースコード
from collections import CounterG, C, P = map(int, input().split())S = input()c = Counter(S)c.setdefault('G', 0)c.setdefault('C', 0)c.setdefault('P', 0)result = 0a = min(G, c['C'])result += 3 * aG -= ac['C'] -= aa = min(C, c['P'])result += 3 * aC -= ac['P'] -= aa = min(P, c['G'])result += 3 * aP -= ac['G'] -= aa = min(G, c['G'])result += aG -= ac['G'] -= aa = min(C, c['C'])result += aC -= ac['C'] -= aa = min(P, c['P'])result += aP -= ac['P'] -= aprint(result)