結果
問題 | No.161 制限ジャンケン |
ユーザー |
![]() |
提出日時 | 2019-12-21 16:10:23 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 39 ms / 5,000 ms |
コード長 | 275 bytes |
コンパイル時間 | 171 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 52,096 KB |
最終ジャッジ日時 | 2024-07-19 15:52:13 |
合計ジャッジ時間 | 1,688 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 |
ソースコード
G, C, P = map(int, input().split())S = input()G2, C2, P2 = S.count('G'), S.count('C'), S.count('P')ans = 3*min(G, C2)+3*min(C, P2)+3*min(P, G2)ans += min(max(0, G2-P), max(0, G-C2))ans += min(max(0, C2-G), max(0, C-P2))ans += min(max(0, P2-C), max(0, P-G2))print(ans)