zoj 2193 poj 2585 Window Pains】的更多相关文章

拓扑排序. 深刻体会:ACM比赛的精髓之处不在于学了某个算法或数据结构,而在于知道这个知识点但不知道这个问题可以用这个知识去解决!一看题目,根本想不到是拓扑排序.T_T...... #include<stdio.h> #include<string.h> #include<math.h> #include<vector> #include<algorithm> using namespace std; ][]; ]; int i, j, k, f…
Window Pains Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 1888   Accepted: 944 Description Boudreaux likes to multitask, especially when it comes to using his computer. Never satisfied with just running one application at a time, he u…
Window Pains Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2027   Accepted: 1025 Description Boudreaux likes to multitask, especially when it comes to using his computer. Never satisfied with just running one application at a time, he…
题意: 在4*4的格子中有9个窗体,窗体会覆盖它之下的窗体,问是否存在一个窗体放置的顺序使得最后的结果与输入同样. 分析: 在数据规模较小且不须要剪枝的情况下能够暴力(思路清晰代码简单),暴力一般分为枚举子集(for(s=0;s<1<<n;++s))和枚举排列(next_permutation). 代码: //poj 2585 //sep9 #include <iostream> #include <algorithm> using namespace std;…
链接:http://poj.org/problem?id=2585 题意: 某个人有一个屏幕大小为4*4的电脑,他很喜欢打开窗口,他肯定打开9个窗口,每个窗口大小2*2.并且每个窗口肯定在固定的位置上(见题目上的图),某些窗口可以覆盖另一些窗口(可以脑补).询问给出的电脑屏幕是否是合法的. 分析: 可以预先处理出每个格子应该有哪几个窗口在这上面,将最上面的窗口与其他窗口连边,得到一张图,用拓扑判环,因为这道题太简单了,所以我就写这么短的题解. 代码: #include<iostream> #i…
题意:你现在有9个2*2的窗口在4*4的屏幕上面,由于这9这小窗口叠放顺序不固定,所以在4*4屏幕上有些窗口只会露出来一部分. 如果电脑坏了的话,那么那个屏幕上的各小窗口叠放会出现错误.你的任务就是判断一下这个电脑到底坏了没有. 讲题之前简单说一下拓扑排序是干啥的: 它是对有向图顶点的一种排序方式,而且拓扑排序的结果可能不止一种 正常步骤为(方法不一定唯一): 从DGA图(有向无环图)中找到一个没有前驱的顶点输出.(可以遍历,也可以用优先队列维护) 删除以这个点为起点的边.(它的指向的边删除,为…
http://poj.org/problem?id=2585 Window Pains Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 1614   Accepted: 806 Description Boudreaux likes to multitask, especially when it comes to using his computer. Never satisfied with just running…
Window Pains Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2524   Accepted: 1284 Description Boudreaux likes to multitask, especially when it comes to using his computer. Never satisfied with just running one application at a time, he…
Window Pains Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 1843   Accepted: 919 Description Boudreaux likes to multitask, especially when it comes to using his computer. Never satisfied with just running one application at a time, he u…
题目连接:problemId=542" target="_blank">ZOJ 1542 POJ 1861 Network 网络 Network Time Limit: 2 Seconds      Memory Limit: 65536 KB      Special Judge Andrew is working as system administrator and is planning to establish a new network in his com…