BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / acm-icpc / #87703同步于 2015/8/16
该镜像源已超过 30 天没有更新,可能在源站已被删除。
ACM_ICPC机器人发帖

问个今天google的oj

icyfox
2015/8/16镜像同步15 回复
题目如下: https://code.google.com/codejam/contest/6234486/dashboard#s=p0 Problem As the leader of the Evil League of Evil, Bad Horse has a lot of problems to deal with. Most recently, there have been far too many arguments and far too much backstabbing in the League, so much so that Bad Horse has decided to split the league into two departments in order to separate troublesome members. Being the Thoroughbred of Sin, Bad Horse isn't about to spend his valuable time figuring out how to split the League members by himself. That what he's got you -- his loyal henchman -- for. Input The first line of the input gives the number of test cases, T. T test cases follow. Each test case starts with a positive integer M on a line by itself -- the number of troublesome pairs of League members. The next M lines each contain a pair of names, separated by a single space. Output For each test case, output one line containing "Case #x: y", where x is the case number (starting from 1) and y is either "Yes" or "No", depending on whether the League members mentioned in the input can be split into two groups with neither of the groups containing a troublesome pair. Limits 1 ≤ T ≤ 100. Each member name will consist of only letters and the underscore character. Names are case-sensitive. No pair will appear more than once in the same test case. Each pair will contain two distinct League members. Small dataset 1 ≤ M ≤ 10. Large dataset 1 ≤ M ≤ 100. Sample: Input 2 1 Dead_Bowie Fake_Thomas_Jefferson 3 Dead_Bowie Fake_Thomas_Jefferson Fake_Thomas_Jefferson Fury_Leika Fury_Leika Dead_Bowie Output Case #1: Yes Case #2: No
订阅后,新回复会通过你的通知中心匿名送达。
9 条回复
icyfox机器人#1 · 2015/8/16
翻译过来大概就是,每行给两个人的名字,表明这个两个人不能在一起 最后判断这个数据集里的所有人,能不能分成两个组,每个组里的人互不冲突。 这算不算个图的分割和连通的问题? 想了很久也没有想出来 其实有几个思路,但是没法证明是一定正确的。
Insane机器人#2 · 2015/8/16
题目理解的应该没问题。。今年的练习题和去年的一模一样。
icyfox机器人#3 · 2015/8/16
-,- 那看来我可以直接搜索答案了.. 【 在 Insane (Insane) 的大作中提到: 】 : 题目理解的应该没问题。。今年的练习题和去年的一模一样。
icyfox机器人#4 · 2015/8/16
我在考虑的问题是: 一个图二分成完全连通图的分法是唯一的吗? 这个没法证明的话,就需要对每个点找他的全连通图。 【 在 Insane (Insane) 的大作中提到: 】 : 题目理解的应该没问题。。今年的练习题和去年的一模一样。
Insane机器人#5 · 2015/8/16
不清楚图论。。我感觉只要能分成一堆,一堆的就返回Yes。不行就返回No 【 在 icyfox 的大作中提到: 】 : 我在考虑的问题是: : 一个图二分成完全连通图的分法是唯一的吗? : 这个没法证明的话,就需要对每个点找他的全连通图。 : ...................
CAPITAL机器人#6 · 2015/8/16
直接黑白染色就可以了
icyfox机器人#7 · 2015/8/16
额。。。理论是这样.. 但是要从一个点作为起点开始找... 不同的点找到的结果一样吗? 【 在 Insane (Insane) 的大作中提到: 】 : 不清楚图论。。我感觉只要能分成一堆,一堆的就返回Yes。不行就返回No
Insane机器人#8 · 2015/8/16
结果一样。这个图分成几个子连通图。每个连通图,看能不能分成两队。不同的子连通图没关系。 【 在 icyfox 的大作中提到: 】 : 额。。。理论是这样.. : 但是要从一个点作为起点开始找... : 不同的点找到的结果一样吗? : ...................
Insane机器人#9 · 2015/8/16
这个思路,应该不错,肯定比我的好。我的是笨法,大数据很慢。 【 在 CAPITAL 的大作中提到: 】 : 直接黑白染色就可以了