工大后院

 找回密码
 加入后院

扫一扫,访问微社区

QQ登录

只需一步,快速开始

搜索
查看: 1816|回复: 2

一齐ACM!!!

[复制链接]
发表于 2006-6-11 01:37 | 显示全部楼层 |阅读模式
ACM:onLine Judge systems:

同济大学 http://acm.tongji.edu.cn/people/ps/index.php

济大学的问题比较入门点, 而且有中文……

开个帖讨论…… 先挂着,考完试再来   

我AC 我快乐!!(AC  :Accepted!!)

网址:
  同济大学 http://acm.tongji.edu.cn/people/ps/index.php   
   浙江大学 http://acm.zju.edu.cn/
   北京大学 http://acm.pku.edu.cn/JudgeOnline/
   四川大学 http://acm.scu.edu.cn/online_judge/index.do
   中国科技大学 http://acm.ustc.edu.cn/
   哈尔滨工业大学 http://acm.hit.edu.cn/acm.php
   汕头大学 http://acm.stu.edu.cn/
    Sphere Online Judge   http://www.spoj.pl/
   Ural State University  http://acm.timus.ru/  (俄国乌拉尔大学)
   University of Valladolid http://acm.uva.es/problemset/
 楼主| 发表于 2006-6-17 18:51 | 显示全部楼层
题目来自 ACM Online Judge  PKU      北大OJ      Problem  ID:1014

Time Limit:1000MS  Memory Limit:10000K

Description
Marsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the marbles had the same value, because then they could just split the collection in half. But unfortunately, some of the marbles are larger, or more beautiful than others. So, Marsha and Bill start by assigning a value, a natural number between one and six, to each marble. Now they want to divide the marbles so that each of them gets the same total value. Unfortunately, they realize that it might be impossible to divide the marbles in this way (even if the total value of all marbles is even). For example, if there are one marble of value 1, one of value 3 and two of value 4, then they cannot be split into sets of equal value. So, they ask you to write a program that checks whether there is a fair partition of the marbles.

Input
Each line in the input file describes one collection of marbles to be divided. The lines contain six non-negative integers n1 , . . . , n6 , where ni is the number of marbles of value i. So, the example from above would be described by the input-line "1 0 1 2 0 0". The maximum total number of marbles will be 20000.
The last line of the input file will be "0 0 0 0 0 0"; do not process this line.

Output
For each collection, output "Collection #k:", where k is the number of the test case, and then either "Can be divided." or "Can't be divided.".
Output a blank line after each test case.

Sample Input


1 0 1 2 0 0
1 0 0 0 1 1
0 0 0 0 0 0

Sample Output


Collection #1:
Can't be divided.

Collection #2:
Can be divided.

Source
Mid-Central European Regional Contest 1999


还没看明白…………

考完试再慢慢看

哪位英语达人译一下 :)

[ 本帖最后由 iptton 于 2006-6-17 18:52 编辑 ]
回复

使用道具 举报

发表于 2006-6-19 20:16 | 显示全部楼层
描述
玛莎和比尔拥有一套大理石的收藏品。 为了使他们都能平等拥有大理石,他们想分了收藏品。 如果每块大理石都是同价值,这样是很容做到的,因为他们只需平分就可以了。 但是不幸的是,有些大理石更大或者更漂亮。 因此, 玛莎和比尔先按价值用自然数1-6标记每个大理石。 他们想分了大理石而每人都得到同等的价值。 不幸地,他们意识到这样分大理石可能是做不到的(即使大理石的总值是偶数)。 举例来说, 如果有一个价值 1 的大理石,一个价值 3 的大理石,两个价值 4 的大理石, 他们是不能分成同价值的两份。 所以, 他们请你写一个程序检测是否有对大理石平等分割的方法。

输入
输入文件的每行都用来描述大理石的分割。 行中包含六个非负整数 n1,…, n6,ni 是数值 i 的大理石的价值。 因此,上面的例子将描述成输入语句 "1 0 1 2 0 0". 大理石的最大总值是20000 。
输入文件的最后一行是 "0 0 0 0 0 0"; 不要处理这一行。

输出
为每分收藏, 输出 "Collection #k:",k 是测试包的编号, 然后输出 "Can be divided." or "Can't be divided."
每个测试外壳后的输出一个空行。

输入举例


1 0 1 2 0 0
1 0 0 0 1 1
0 0 0 0 0 0


输出举例


Collection #1:
Can't be divided.

Collection #2:
Can be divided.

来源
Mid-Central European Regional Contest 1999




不过我不会做

[ 本帖最后由 liuaa24 于 2006-6-19 20:20 编辑 ]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 加入后院

本版积分规则

QQ|Archiver|手机版|小黑屋|广告业务Q|工大后院 ( 粤ICP备10013660号 )

GMT+8, 2025-5-15 07:21

Powered by Discuz! X3.5

Copyright © 2001-2024 Tencent Cloud.

快速回复 返回顶部 返回列表