0
点赞
收藏
分享

微信扫一扫

Teamwork(翻译)

律楷粑粑 2022-02-12 阅读 49
c++

http://noi.openjudge.cn/english/21/

描述

There are N candidates. Each candidate has a cooperation value and a working value. Select a subset of candidates to form a team, such that the sum of cooperation values is positive and the sum of working values is maximum.

输入

First line: one positive integer N (N <= 100).
Next N lines: the i-th line contains two integers (between -100 and 100), indicating the cooperation value and the working value of the i-th candidate.

输出

One line contains several integers, indicating the indexes of selected candidates.

                                    团队合作

描述:

有 N 个候选人.每个候选人都有一个合作值和工作值。选择候选人的子集以形成团队,使得合作值的总和为正,工作值的总和最大值。输入:

第一行:

一个正整数 N (N < = 100)。
接下来的N行:第i行包含两个整数(在-100和100之间),表示第i个候选项的合作值和工作值。

输出:

一行包含多个整数,指示所选候选项的索引

举报

相关推荐

0 条评论