poj 2572 Hard to Believe, but True!】的更多相关文章

Hard to Believe, but True! Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 3537   Accepted: 2024 Description The fight goes on, whether to store numbers starting with their most significant digit or their least significant digit. Sometim…
#include<stdio.h> #include<iostream> #include<string> using namespace std; int main() { //freopen("acm.acm","r",stdin); string s; int pos; int pos1; string s1; string s2; string s3; int i; int sum1; int sum2; int sum3…
Time Limit: 1000MSMemory Limit: 10000K Total Submissions: 947Accepted: 345Special Judge Description The Department of Recreation has decided that it must be more profitable, and it wants to sell advertising space along a popular jogging path at a loc…
题目链接:http://poj.org/problem?id=1417 题意:就是给出n个问题有p1个好人,p2个坏人,问x,y是否是同类人,坏人只会说谎话,好人只会说实话. 最后问能否得出全部的好人编号是多少并且从小到大输出 由于好人只说实话坏人只说谎话.一个人说另一个人不是同类,如果他是好人那么另外一个人就是坏人,如果这是坏人那么另外一个人就是也是坏人 一个人说另一个人是同类,如果他是好人那么另一个人就是好人,如果这时坏人那么另一个人也是好人. 所以这种关系正好方便枚举,因为要么这群人是好人…
题目链接:http://poj.org/problem?id=1417 Time Limit: 1000MS Memory Limit: 10000K Description After having drifted about in a small boat for a couple of days, Akira Crusoe Maeda was finally cast ashore on a foggy island. Though he was exhausted and despair…
True Liars After having drifted about in a small boat for a couple of days, Akira Crusoe Maeda was finally cast ashore on a foggy island. Though he was exhausted and despaired, he was still fortunate to remember a legend of the foggy island, which he…
题目大意: 一共有p1+p2个人,分成两组,一组p1,一组p2.给出N个条件,格式如下: x y yes表示x和y分到同一组,即同是好人或者同是坏人. x y no表示x和y分到不同组,一个为好人,一个为坏人 这个可以自己分析一下, 很简单. 问分组情况是否唯一,若唯一则输出p1的成员,否则输出no.保证不存在矛盾条件,但是有可能出现x=y的情况. 思路: 参考链接:http://www.cnblogs.com/kuangbin/archive/2013/04/06/3002498.html 用…
题意:有两种人,一种人只会说真话,另一种人只会说假话.只会说真话的人有p1个,另一种人有p2个.给出m个指令,每个指令为a b yes/no,意思是,如果为yes,a说b是只说真话的人,如果为no,a说b是只说假话的人.注意,a可以为b.保证每个指令都是正确的,且相互之间不矛盾.问,能不能确定哪些人是说真话的人,如果能,输出所有只说真话的人:如果不能,输出no. 解法:首先,用并查集建树,每个节点有两个参数,f和r,f表示父亲节点的编号,r表示与父亲节点是不是同一种人.r为0表示该节点与父亲节点…
The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 22286   Accepted: 8603   Special Judge Description The game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a…
Flip Game Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 37427   Accepted: 16288 Description Flip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and the…