登录
首页 » 电子书 » Tug of War(A tug of war is to be arranged at the local office picnic. For the tu...

Tug of War(A tug of war is to be arranged at the local office picnic. For the tu...

于 2023-08-25 发布 文件大小:1.14 kB
0 17
下载积分: 2 下载次数: 1

代码说明:

Tug of War(A tug of war is to be arranged at the local office picnic. For the tug of war, the picnickers must be divided into two teams. Each person must be on one team or the other the number of people on the two teams must not differ by more than 1 the total weight of the people on each team should be as nearly equal as possible. The first line of input contains n the number of people at the picnic. n lines follow. The first line gives the weight of person 1 the second the weight of person 2 and so on. Each weight is an integer between 1 and 450. There are at most 100 people at the picnic. Your output will be a single line containing 2 numbers: the total weight of the people on one team, and the total weight of the people on the other team. If these numbers differ, give the lesser first. )

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 696524资源总数
  • 103913会员总数
  • 34今日下载