Codeforces 442A Borya and Hanabi】的更多相关文章

有五种花色 外加 五种点数 共25张牌,每次有n张牌,主人知道这n张牌中有哪些牌,并且哪种牌有几张,但是不知道具体是哪张牌,他可以问某种花色,然后知道了哪几张是该花色,也可以问点数,然后就知道了哪几张是这个点数.最终可以把所有牌都确定下来,问最少要询问几次. 这个题目一开始想到枚举(事实证明最后就是枚举),然后又想到二分图去了,..主要是这个花色对应点数,连成边之后太像二分图了,而且感觉为了得到所有的牌,隐隐约约有点像 DAG上的最小点覆盖...而且看了下样例,有点像,所以就去敲二分图去了,结果…
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…
题目链接: 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 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…
题目链接 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…
题目连接 题意: n表示有n个卡片.每一个卡片有一种颜色和一个数字(共五种不同的颜色和五个不同的数字). 事先知道每种卡片有几张.可是不知道详细的位置. 问须要几次提示就能够知道全部卡片的位置都在哪里:每次提示能够选择一个颜色或者一个数字.就能够知道含有所选属性的牌有哪些. 分析: 首先明确总情况数不多,仅仅有2^10,所以枚举. 能确定某张牌位置的情况:1)提示了一个属性,而这个属性仅仅有一张牌 2)某个属性有n张牌,知道了n-1张牌的位置 两个提示确定一张牌:必定的,仅仅要存在这张牌.那么两…
题目链接:http://codeforces.com/problemset/problem/442/A 题目大意:给你n张卡片,你知道这n张卡片都是什么,但是不知道他们的位置.你每次可以请求朋友指出一种颜色的卡片,或者一种数字的卡片.问你最少需要多少次能够知道每个卡片的位置. 首先,如果其他所有卡片都知道了,最后一张卡片不需要指示就知道了. 然后我们枚举哪张是最后一张卡片. 将五种颜色放在x轴,5个数字放在y轴. 一次询问就是画一条线,先去掉交叉点,再看剩下的点是不是唯一在一条直线里. bitm…
layout: post title: Codeforces Round 253 (Div. 2) author: "luowentaoaa" catalog: true tags: mathjax: true - codeforces - 模拟栈 - 贪心 传送门 A.Anton and Letters (签到) 题意 判断字符串里面有多少个不同字符 思路 直接set一下 #include<bits/stdc++.h> using namespace std; typed…
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…
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 模拟 [代码] #include <bits/stdc++.h> using namespace std; const int N = 1000; int n; pair <int,int> a[N+10]; int main(){ // freopen("rush.txt","r",stdin); scanf("%d",&n); for (int…