結果

問題 No.161 制限ジャンケン
ユーザー yuppe19 😺yuppe19 😺
提出日時 2015-05-17 09:50:06
言語 Python2
(2.7.18)
結果
AC  
実行時間 14 ms / 5,000 ms
コード長 386 bytes
コンパイル時間 850 ms
コンパイル使用メモリ 6,748 KB
実行使用メモリ 6,448 KB
最終ジャッジ日時 2023-08-20 04:30:33
合計ジャッジ時間 1,418 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
6,448 KB
testcase_01 AC 13 ms
6,216 KB
testcase_02 AC 13 ms
6,292 KB
testcase_03 AC 13 ms
6,352 KB
testcase_04 AC 13 ms
6,248 KB
testcase_05 AC 13 ms
6,376 KB
testcase_06 AC 14 ms
6,352 KB
testcase_07 AC 13 ms
6,352 KB
testcase_08 AC 13 ms
6,432 KB
testcase_09 AC 14 ms
6,352 KB
testcase_10 AC 13 ms
6,244 KB
testcase_11 AC 13 ms
6,200 KB
testcase_12 AC 14 ms
6,376 KB
testcase_13 AC 13 ms
6,348 KB
testcase_14 AC 14 ms
6,248 KB
testcase_15 AC 13 ms
6,244 KB
testcase_16 AC 13 ms
6,352 KB
testcase_17 AC 13 ms
6,292 KB
testcase_18 AC 14 ms
6,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
from collections import Counter

def func(pos, bai, k):
    tmp = min(counter[k], arr[pos])
    counter[k] -= tmp
    arr[pos] -= tmp
    return tmp * bai

s = 'GCP'
arr = map(int, raw_input().split())
counter = Counter(raw_input())
res = sum(func(s.index(k) - 1, 3, k) for k in counter.keys()) \
    + sum(func(s.index(k),     1, k) for k in counter.keys())
print res
0