結果

問題 No.161 制限ジャンケン
ユーザー (ΦωΦ)(ΦωΦ)
提出日時 2015-04-13 16:48:54
言語 Python2
(2.7.18)
結果
AC  
実行時間 13 ms / 5,000 ms
コード長 428 bytes
コンパイル時間 519 ms
コンパイル使用メモリ 6,520 KB
実行使用メモリ 6,448 KB
最終ジャッジ日時 2023-08-20 04:27:30
合計ジャッジ時間 1,251 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
6,376 KB
testcase_01 AC 13 ms
6,276 KB
testcase_02 AC 12 ms
6,212 KB
testcase_03 AC 13 ms
6,300 KB
testcase_04 AC 12 ms
6,244 KB
testcase_05 AC 13 ms
6,264 KB
testcase_06 AC 13 ms
6,380 KB
testcase_07 AC 13 ms
6,248 KB
testcase_08 AC 13 ms
6,276 KB
testcase_09 AC 13 ms
6,448 KB
testcase_10 AC 13 ms
6,296 KB
testcase_11 AC 13 ms
6,296 KB
testcase_12 AC 13 ms
6,192 KB
testcase_13 AC 13 ms
6,356 KB
testcase_14 AC 13 ms
6,232 KB
testcase_15 AC 13 ms
6,444 KB
testcase_16 AC 12 ms
6,248 KB
testcase_17 AC 13 ms
6,224 KB
testcase_18 AC 13 ms
6,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

s = 'GCP'
arr = map(int, raw_input().split())
counter = Counter(raw_input())
res = 0
for k, v in counter.items():
    winpos = s.index(k) - 1
    tmp = min(v, arr[winpos])
    res += tmp * 3
    counter[k] -= tmp
    arr[winpos] -= tmp
for k, v in counter.items():
    drawpos = s.index(k)
    res += min(v, arr[drawpos])
    counter[k] -= tmp
    arr[drawpos] -= tmp
print res
0