結果
| 問題 | No.161 制限ジャンケン |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-05-17 09:50:06 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 88 ms / 5,000 ms |
| コード長 | 386 bytes |
| 記録 | |
| コンパイル時間 | 136 ms |
| コンパイル使用メモリ | 77,584 KB |
| 最終ジャッジ日時 | 2025-12-03 15:09:14 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 |
ソースコード
#!/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