Windows Pains poj 2585】的更多相关文章

Boudreaux likes to multitask, especially when it comes to using his computer. Never satisfied with just running one application at a time, he usually runs nine applications, each in its own window. Due to limited screen real estate, he overlaps these…
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;…
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…
链接:http://poj.org/problem?id=2585 题意: 某个人有一个屏幕大小为4*4的电脑,他很喜欢打开窗口,他肯定打开9个窗口,每个窗口大小2*2.并且每个窗口肯定在固定的位置上(见题目上的图),某些窗口可以覆盖另一些窗口(可以脑补).询问给出的电脑屏幕是否是合法的. 分析: 可以预先处理出每个格子应该有哪几个窗口在这上面,将最上面的窗口与其他窗口连边,得到一张图,用拓扑判环,因为这道题太简单了,所以我就写这么短的题解. 代码: #include<iostream> #i…
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…
拓扑排序. 深刻体会:ACM比赛的精髓之处不在于学了某个算法或数据结构,而在于知道这个知识点但不知道这个问题可以用这个知识去解决!一看题目,根本想不到是拓扑排序.T_T...... #include<stdio.h> #include<string.h> #include<math.h> #include<vector> #include<algorithm> using namespace std; ][]; ]; int i, j, k, f…
Description . . . and so on . . . Unfortunately, Boudreaux's computer is very unreliable and crashes often. He could easily tell if a crash occurred by looking at the windows and seeing a graphical representation that should not occur if windows were…
题意: 一个屏幕要同时打开9个窗口,每个窗口是2*2的矩阵,整个屏幕大小是9*9,每个窗口位置固定. 但是是否被激活(即完整显示出来)不确定. 给定屏幕状态,问是否可以实现显示. 分析:拓扑排序,把完全出现的数字拿出来,位置置空,然后再找下一个完全出现的数,直到找完为止,若中途找不到,则不合法. 代码: #include<cstdio> #include<iostream> #include<cstring> using namespace std; ],pos[][]…
题意:你现在有9个2*2的窗口在4*4的屏幕上面,由于这9这小窗口叠放顺序不固定,所以在4*4屏幕上有些窗口只会露出来一部分. 如果电脑坏了的话,那么那个屏幕上的各小窗口叠放会出现错误.你的任务就是判断一下这个电脑到底坏了没有. 讲题之前简单说一下拓扑排序是干啥的: 它是对有向图顶点的一种排序方式,而且拓扑排序的结果可能不止一种 正常步骤为(方法不一定唯一): 从DGA图(有向无环图)中找到一个没有前驱的顶点输出.(可以遍历,也可以用优先队列维护) 删除以这个点为起点的边.(它的指向的边删除,为…
这题主要在于建图.对9个2*2的小块,第i块如果出现了不等于i的数字,那么一定是在i之后被brought的.可以从i到该数字建一条边. 图建好后,进行一次拓扑排序,判段是否存在环.若存在环,那么就是BROKEN,否则是CLEAN. #include<iostream> #include<cstdio> #include<cstring> #define Maxn 102 #define Maxm 10010 using namespace std; ]; int Top…
题目链接: http://poj.org/problem?id=3923 题意描述: 输入一个n*m的屏幕 该屏幕内有至少一个对话框(每个对话框都有对应的字母表示) 判断并输出该屏幕内处于最表层的对话框是哪些(有多个的话按字典序) 解题思路: 很接近生活的一道模拟题,考察了思维的缜密性,尤其是出现嵌套情况时,应该输出里层的对话框编号即可. AC代码: #include<stdio.h> #include<string.h> #include<ctype.h> ][];…
Ugly Windows Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1670    Accepted Submission(s): 693 Problem Description Sheryl works for a software company in the country of Brada. Her job is to d…
[题目链接] http://poj.org/problem?id=2482 [算法] 线段树 + 扫描线 [代码] #include <algorithm> #include <bitset> #include <cctype> #include <cerrno> #include <clocale> #include <cmath> #include <complex> #include <cstdio> #…
[问题描述] 给你一个长度为N的数组,一个长为K的滑动的窗体从最左移至最右端,你只能见到窗口的K个数,每次窗体向右移动一位,如下表: [样例输入] 8 3 1 3 -1 -3 5 3 6 7 [样例输出] -1 -3 -3 -3 3 3 3 3 5 5 6 7 [解题思路] 首先,不难想到用枚举的办法,对于每一个区间,枚举其中的最大值和最小值,但对于n<=1000000的数据来说,枚举必定超时,因此我们可以用到队列来进行优化. 我们取前k个数中的最大值和最小值,放入两个队列中,设放最大值的为k,…
Sliding Window Time Limit: 12000MS   Memory Limit: 65536K Total Submissions: 73426   Accepted: 20849 Case Time Limit: 5000MS Description An array of size n ≤ 106 is given to you. There is a sliding window of size k which is moving from the very left…
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: 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…
A Simple Problem with Integers Description You have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is to ask for the sum of…
http://technet.microsoft.com/zh-CN/sysinternals http://technet.microsoft.com/en-us/sysinternals/bb896647 我们利用debugView 命令可以自动生成log文件,而且是atomic. cmd -h就可以看到了. 用ShellExeccute 从codeProject 搜索debugview 刚找到一些 http://www.codeproject.com/Articles/13345/DbMo…
1.链接地址: http://bailian.openjudge.cn/practice/2775 http://poj.org/problem?id=1057 2.题目: 总时间限制: 1000ms 内存限制: 65536kB 描述 在计算机上看到文件系统的结构通常很有用.Microsoft Windows上面的"explorer"程序就是这样的一个例子.但是在有图形界面之前,没有图形化的表示方法的,那时候最好的方式是把目录和文件的结 构显示成一个"图"的样子,而…
acm之pku题目分类 对ACM有兴趣的同学们可以看看 DP:  1011   NTA                 简单题  1013   Great Equipment     简单题  1024   Calendar Game       简单题  1027   Human Gene Functions   简单题  1037   Gridland            简单题  1052   Algernon s Noxious Emissions 简单题  1409   Commun…
Split Windows 题目链接:http://poj.org/problem?id=1108 题目大意: 给你一棵二叉树的先序遍历,有三种字符:|.-.A~Z,然后用窗口表示出来,|: 表示将当前窗口分为左右两半:-: 表示将当前窗口分为上下两半:A~Z: 为当前窗口命名.初始状态为一个大窗口,比如先序序列:|A-BC 表示,当然,形状是不长这样的,具体看样例,但大概意思就是这样.对于每一个小窗口,首先要做到最简,然后和旁边的窗口合并的时候要注意比例,如果出现小数,就左边的.上面的进一,右…
结论题,这题关键在于如何转换环,可以用tarjan求出连通分量后再进行标记,也可以DFS直接找到环后把点的SG值变掉就行了 /** @Date : 2017-10-23 19:47:47 * @FileName: POJ 3710 简单环 树上删边 DFS.cpp * @Platform: Windows * @Author : Lweleth (SoungEarlf@gmail.com) * @Link : https://github.com/ * @Version : $Id$ */ #i…
求n个圆中没有被包含的圆.模仿扫描线从左往右扫,到左边界此时如有3个交点,则有3种情况,以此判定该圆是否被离它最近的圆包含,而交点和最近的圆可以用以y高度排序的Set来维护.因此每次到左边界插入该圆,找该圆最近的两个圆(上方和下方)判断是否包含,到右边界则从Set中删除该圆. /** @Date : 2017-08-13 17:27:55 * @FileName: POJ 2932 圆扫描线.cpp * @Platform: Windows * @Author : Lweleth (SoungE…
长为n的一列格子,轮流放同种棋子,率先使棋子连成3个者胜. 可以发现每次放一个棋子后,后手都不能放在[x-2,x+2]这个区间,那么相当于每次放棋将游戏分成了两个,不能放棋者败. 暴力求SG即可 /** @Date : 2017-10-14 22:50:13 * @FileName: POJ 3537 multi-sg 暴力SG.cpp * @Platform: Windows * @Author : Lweleth (SoungEarlf@gmail.com) * @Link : https:…
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight Moves1101 Gamblers1204 Additive equations 1221 Risk1230 Legendary Pokemon1249 Pushing Boxes 1364 Machine Schedule1368 BOAT1406 Jungle Roads1411 Annive…
汽车每过一单位消耗一单位油,其中有给定加油站可加油,问到达终点加油的最小次数. 做法很多的题,其中优先对列解这题是很经典的想法,枚举每个加油站,判断下当前油量是否小于0,小于0就在前面挑最大几个直至油量大于0. 虽然是道挺水的题目,但还是要注意细节... /** @Date : 2017-09-21 22:45:37 * @FileName: POJ 2431 优先队列.cpp * @Platform: Windows * @Author : Lweleth (SoungEarlf@gmail.…
LINK 题意:给出一个多边形,求是否存在核. 思路:比较裸的题,要注意的是求系数和交点时的x和y坐标不要搞混...判断核的顶点数是否大于1就行了 /** @Date : 2017-07-20 19:55:49 * @FileName: POJ 3335 半平面交求核.cpp * @Platform: Windows * @Author : Lweleth (SoungEarlf@gmail.com) * @Link : https://github.com/ * @Version : $Id$…