結果
問題 | No.161 制限ジャンケン |
ユーザー |
|
提出日時 | 2015-05-17 09:50:06 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 13 ms / 5,000 ms |
コード長 | 386 bytes |
コンパイル時間 | 72 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 6,784 KB |
最終ジャッジ日時 | 2024-11-30 04:35:53 |
合計ジャッジ時間 | 1,020 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 |
ソースコード
#!/usr/bin/pythonfrom collections import Counterdef func(pos, bai, k):tmp = min(counter[k], arr[pos])counter[k] -= tmparr[pos] -= tmpreturn tmp * bais = '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