結果
| 問題 | No.161 制限ジャンケン |
| コンテスト | |
| ユーザー |
(ΦωΦ)
|
| 提出日時 | 2015-04-13 16:45:52 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
AC
|
| 実行時間 | 61 ms / 5,000 ms |
| + 538µs | |
| コード長 | 565 bytes |
| 記録 | |
| コンパイル時間 | 63 ms |
| コンパイル使用メモリ | 80,964 KB |
| 実行使用メモリ | 80,872 KB |
| 最終ジャッジ日時 | 2026-07-17 12:52:39 |
| 合計ジャッジ時間 | 2,469 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 |
ソースコード
#!/usr/bin/python
from collections import Counter
def doit(op_hand, my_hand, point):
if not op_hands[op_hand]:
return 0
tmp = min(op_hands[op_hand], my_hands[my_hand])
res = tmp * point
op_hands[op_hand] -= tmp
my_hands[my_hand] -= tmp
return res
s = 'GCP'
arr = map(int, raw_input().split())
my_hands = {k: v for k, v in zip(s, arr)}
op_hands = Counter(raw_input())
res = 0
for k, v in my_hands.items():
weak_op = s[s.find(k) - 2]
res += doit(weak_op, k, 3)
for k, v in my_hands.items():
res += doit(k, k, 1)
print res
(ΦωΦ)