ZOJ 3811 Untrusted Patrol】的更多相关文章

Untrusted Patrol Time Limit: 3 Seconds      Memory Limit: 65536 KB Edward is a rich man. He owns a large factory for health drink production. As a matter of course, there is a large warehouse in the factory. To ensure the safety of drinks, Edward hir…
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3811 解题报告:一个无向图上有n个点和m条边,其中有k个点上安装了传感器,当有人第一次从安装了传感器的点上经过时,在控制室就会收到一个信号,现在保安制定 了一条路线目的是要将所有的点都巡逻一遍,然后在控制室收到了 L 次信号,按顺序给出收到信号的点,问这条路线是否是有可能的? 路线的不可能的情况比如收到信号的点的顺序是123,但是在无向图上要到达2这个点必定先经…
Description Edward is a rich man. He owns a large factory for health drink production. As a matter of course, there is a large warehouse in the factory. To ensure the safety of drinks, Edward hired a security man to patrol the warehouse. The warehous…
题目大意:给一个无向图,有些点有装监视器记录第一次到达该点的位置,问是否存在一条路径使得监视器以给定的顺序响起,并且经过所有点 思路:牡丹江网络赛的题,当时想了种并查集的做法,通神写完程序WA了几发,此时JYB用BFS秒了,索性最后还是调出来了,今天自己写了下,感觉唯一的坑点就是需要遍历完所有的点 //zoj3811 #include <stdio.h> #include <string.h> #include <algorithm> #include <queu…
2014牡丹江网络赛C题 (第三水的题 The 2014 ACM-ICPC Asia Mudanjiang Regional First Round http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3811 Untrusted Patrol Time Limit: 3 Seconds      Memory Limit: 65536 KB Edward is a rich man. He owns a large fact…
Untrusted Patrol Time Limit: 3 Seconds                                     Memory Limit: 65536 KB                             Edward is a rich man. He owns a large factory for health drink production. As a matter of course, there is a large warehouse…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5343 网络赛这水题没写过太伤了,赛后写了下1A. 当时钻牛角尖一定要用k次bfs,其实一次就够了,把扩展到的节点插入set中,复杂度nlogn #include <iostream> #include <cstdio> #include <cstring> #include <set> #include <vector> #i…
The Himalayas http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5341 签到 #include<cstdio> int main(){ ]; while(~scanf("%d",&t)){ while(t--){ scanf("%d",&n); ;i<=n;i++){ scanf("%d",&a[i]); } ; ;i&l…
第十三届浙江省大学生程序设计竞赛 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…