ZOJ-3960 What Kind of Friends Are You?】的更多相关文章

地址:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3960 题目: Japari Park is a large zoo home to extant species, endangered species, extinct species, cryptids and some legendary creatures. Due to a mysterious substance known as Sandstar, a…
题目链接 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3960 题意 首先给出 一系列名字 需要辨别的名字,然后给出Q个问题,每个问题有 若干个人给出答案,给出答案的人 此时状态 为1 没有给出答案 的 状态为0 最后给出 三个需要辨识的状态,如果有且只有一个人 跟这个状态相同 就输出这个人的名字 AC代码 #include <cstdio> #include <cstring> #include <…
比赛的时候用vector交集做的...情况考虑的不全面  wrong到疯 赛后考虑全了情况....T了 果然 set_intersection  不能相信 嗯 不好意思 交集a了  第二个代码 求出来每个1的交集 为0的时候  要减去相同的元素 看最后一个案例的B和K的输出想想为什么 另一个做法就是处理出每个人名的序列 然后输入序列的时候去找一样的 如果只有一个 那就是它了 #include <iostream> #include <cstdio> #include <sst…
题目链接 :http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5592 Japari Park is a large zoo home to extant species, endangered species, extinct species, cryptids and some legendary creatures. Due to a mysterious substance known as Sandstar, all…
怎么说呢...我能说我又过了一道水题? emm... 问题描述: 给定 n 个待确定名字的 Friends 和 q 个问题.已知 c 个 Friends 的名字. 对于第 i 个问题,有  个 Friends 会回答 yes ,其余  个 Friends 均回答 no . 现在给定 n 个待确定名字的 Friends 以及他们对于 q 个问题的回答.若能够确定它的名字,给出:否则,输出 Let's Go to the library!! 思路: 对于回答yes的,在当前人结果上加1,而回答no时…
What Kind of Friends Are You? Time Limit: 1 Second      Memory Limit: 65536 KB Japari Park is a large zoo home to extant species, endangered species, extinct species, cryptids and some legendary creatures. Due to a mysterious substance known as Sands…
What Kind of Friends Are You? Time Limit: 1 Second Memory Limit: 65536 KB Japari Park is a large zoo home to extant species, endangered species, extinct species, cryptids and some legendary creatures. Due to a mysterious substance known as Sandstar,…
今日这场比赛我们准备的题比较全面,二分+数论+最短路+计算几何+dp+思维+签到题等.有较难的防AK题,也有简单的签到题.为大家准备了一份题解和AC代码. A - Meeting with Aliens UVA - 10570 题目意思:让一个成环的序列变成有序的,正序逆序都可以,问最小交换次数. 解题思路:对于一个长度为n的元素互异的序列,通过交换实现有序的最小的交换次数是=n - 被分解成单循环的个数.数据比较小,正着来一遍,反着来一遍,取最小就可以了. #include<iostream>…
第十三届浙江省大学生程序设计竞赛 I 题, 一道模拟题. ZOJ  3944http://www.icpc.moe/onlinejudge/showProblem.do?problemCode=3944 In a BG (dinner gathering) for ZJU ICPC team, the coaches wanted to count the number of people present at the BG. They did that by having the waitre…
A Simple Tree Problem Time Limit: 3 Seconds      Memory Limit: 65536 KB Given a rooted tree, each node has a boolean (0 or 1) labeled on it. Initially, all the labels are 0. We define this kind of operation: given a subtree, negate all its labels. An…