結果

問題 No.161 制限ジャンケン
コンテスト
ユーザー e-mon
提出日時 2015-03-05 23:49:50
言語 Python3
(3.14.3 + numpy 2.4.2 + scipy 1.17.0)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 392 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 613 ms
コンパイル使用メモリ 20,952 KB
実行使用メモリ 15,616 KB
最終ジャッジ日時 2026-03-10 11:56:09
合計ジャッジ時間 3,070 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#!/usr/bin/env python
# -*- coding: utf-8 -*-

hand_num = list(map(int,input().split()))
hand = {'G':0,'C':1,'P':2}

S = input()
point = 0
for s in S:
    if hand_num[(hand[s] + 2)%3]  > 0:
        hand_num[(hand[s] + 2)%3] -= 1
        point += 3
    elif hand_num[hand[s]] > 0:
        hand_num[hand[s]] -= 1
        point += 1
    else:
        hand_num[(hand[s] + 1)%3] -= 1
print(point)
0