結果
問題 | No.161 制限ジャンケン |
ユーザー | noko2250 |
提出日時 | 2015-03-16 02:06:18 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 587 bytes |
コンパイル時間 | 1,829 ms |
コンパイル使用メモリ | 86,300 KB |
実行使用メモリ | 71,372 KB |
最終ジャッジ日時 | 2023-09-11 08:27:40 |
合計ジャッジ時間 | 2,960 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 74 ms
71,244 KB |
testcase_01 | AC | 74 ms
71,156 KB |
testcase_02 | AC | 74 ms
71,124 KB |
testcase_03 | AC | 73 ms
71,152 KB |
testcase_04 | AC | 74 ms
71,228 KB |
testcase_05 | AC | 73 ms
71,172 KB |
testcase_06 | AC | 73 ms
71,044 KB |
testcase_07 | AC | 75 ms
71,012 KB |
testcase_08 | AC | 76 ms
70,920 KB |
testcase_09 | AC | 75 ms
71,192 KB |
testcase_10 | AC | 74 ms
71,272 KB |
testcase_11 | AC | 74 ms
71,064 KB |
testcase_12 | AC | 72 ms
71,296 KB |
testcase_13 | AC | 74 ms
71,192 KB |
testcase_14 | WA | - |
testcase_15 | AC | 74 ms
71,372 KB |
testcase_16 | AC | 75 ms
71,000 KB |
testcase_17 | AC | 75 ms
71,288 KB |
testcase_18 | WA | - |
ソースコード
#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 G -= 1 if s == 'P' and P > 0 : ans += 3 P -= 1 print(ans)