codeforces 422A A. Borya and Hanabi(暴力)】的更多相关文章

题目链接: A. Borya and Hanabi time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Have you ever played Hanabi? If not, then you've got to try it out! This problem deals with a simplified version o…
A. Borya and Hanabi Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/442/problem/A Description Have you ever played Hanabi? If not, then you've got to try it out! This problem deals with a simplified version of the game. Ove…
题目链接:http://codeforces.com/problemset/problem/442/A 题目大意:给你n张卡片,你知道这n张卡片都是什么,但是不知道他们的位置.你每次可以请求朋友指出一种颜色的卡片,或者一种数字的卡片.问你最少需要多少次能够知道每个卡片的位置. 首先,如果其他所有卡片都知道了,最后一张卡片不需要指示就知道了. 然后我们枚举哪张是最后一张卡片. 将五种颜色放在x轴,5个数字放在y轴. 一次询问就是画一条线,先去掉交叉点,再看剩下的点是不是唯一在一条直线里. bitm…
A. Borya and Hanabi time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Have you ever played Hanabi? If not, then you've got to try it out! This problem deals with a simplified version of the…
题目连接 题意: n表示有n个卡片.每一个卡片有一种颜色和一个数字(共五种不同的颜色和五个不同的数字). 事先知道每种卡片有几张.可是不知道详细的位置. 问须要几次提示就能够知道全部卡片的位置都在哪里:每次提示能够选择一个颜色或者一个数字.就能够知道含有所选属性的牌有哪些. 分析: 首先明确总情况数不多,仅仅有2^10,所以枚举. 能确定某张牌位置的情况:1)提示了一个属性,而这个属性仅仅有一张牌 2)某个属性有n张牌,知道了n-1张牌的位置 两个提示确定一张牌:必定的,仅仅要存在这张牌.那么两…
有五种花色 外加 五种点数 共25张牌,每次有n张牌,主人知道这n张牌中有哪些牌,并且哪种牌有几张,但是不知道具体是哪张牌,他可以问某种花色,然后知道了哪几张是该花色,也可以问点数,然后就知道了哪几张是这个点数.最终可以把所有牌都确定下来,问最少要询问几次. 这个题目一开始想到枚举(事实证明最后就是枚举),然后又想到二分图去了,..主要是这个花色对应点数,连成边之后太像二分图了,而且感觉为了得到所有的牌,隐隐约约有点像 DAG上的最小点覆盖...而且看了下样例,有点像,所以就去敲二分图去了,结果…
M. Variable Shadowing Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100513/problem/M Description In computer programming, variable shadowing occurs when a variable declared within a certain scope has the same name as a variab…
G. FacePalm Accounting Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100513/problem/G Description An owner of a small company FacePalm has recently learned that the city authorities plan to offer to small businesses to partic…
"Cricket Field" Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100002 Description Once upon a time there was a greedy King who ordered his chief Architect to build a field for royal cricket inside his park. The King was so…
A. Arya and Bran time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Bran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give him some Candies…