結果
| 問題 |
No.161 制限ジャンケン
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-03-26 15:17:07 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 445 bytes |
| コンパイル時間 | 307 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-06-29 01:02:08 |
| 合計ジャッジ時間 | 1,405 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 WA * 9 |
ソースコード
def calc(win,draw,lose,res):
if win > 0:
win -= 1
res += 3
elif draw > 0:
draw -= 1
res += 1
else:
lose -= 1
return [win,draw,lose,res]
G,C,P = [int(x) for x in input().split(" ")]
S = input()
res = 0
for x in S:
if x == 'G':
P,G,C,res = calc(P,G,C,res)
elif x == 'C':
G,C,P,res = calc(G,C,P,res)
else:
C,P,G,res = calc(C,P,G,res)
print(res)