結果

問題 No.161 制限ジャンケン
ユーザー e-mone-mon
提出日時 2015-03-05 23:49:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 392 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 10,644 KB
実行使用メモリ 7,924 KB
最終ジャッジ日時 2023-09-06 15:13:21
合計ジャッジ時間 1,320 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 15 ms
7,712 KB
testcase_02 AC 16 ms
7,728 KB
testcase_03 AC 15 ms
7,744 KB
testcase_04 WA -
testcase_05 AC 15 ms
7,748 KB
testcase_06 AC 15 ms
7,848 KB
testcase_07 AC 15 ms
7,712 KB
testcase_08 AC 15 ms
7,756 KB
testcase_09 AC 15 ms
7,892 KB
testcase_10 AC 15 ms
7,756 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 15 ms
7,880 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/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