POJ 2162 Document Indexing(模拟)】的更多相关文章

Description Andy is fond of old computers. He loves everything about them and he uses emulators of old operating systems on his modern computer. Andy also likes writing programs for them. Recently he has decided to write a text editor for his favorit…
B. Text Document Analysis 题目连接: http://codeforces.com/contest/723/problem/B Description Modern text editors usually show some information regarding the document being edited. For example, the number of words, the number of pages, or the number of cha…
Description Too worrying about the house price bubble, poor Mike sold his house and rent an apartment in a 50-floor building several months ago. This building has only one elevator because it is a so called “rotten tail building”. There are always a…
题目链接: http://poj.org/problem?id=2632 题目描述: 有一个B*A的厂库,分布了n个机器人,机器人编号1~n.我们知道刚开始时全部机器人的位置和朝向,我们可以按顺序操控机器人,没有两个机器人可以同时执行命令.如果机器人走到厂库边界,他将碰到墙,如果两个机器人走到同一位置,则表示他们两个相撞.问m个命令内最先发生的碰撞,如果没有碰撞输出“OK”. 解题思路: 由图可知,本题的矩阵与平时的不太一样,所以我们在对厂库进行操作的时候,可以先把厂库顺时针旋转90°,当然,方…
http://poj.org/problem?id=2014 嘻嘻2014要到啦,于是去做Prob.ID 为2014的题~~~~祝大家新年快乐~~ 题目大意: 给你一个最大宽度的矩形,要求把小矩形排放在内,只有当这一行小矩形的宽度超过最大宽度后,才能放入下一行. 求最后放好后的宽度和高度. (具体看题目吧,好像表述得不太清楚) 思路: 就按题目给定矩形的顺序直接来模拟就好了.. 不用旋转不用排序各种不要... #include<cstdio> #include<algorithm>…
题目链接:http://poj.org/problem?id=2632 先话说昨天顺利1Y之后,直到今天下午才再出题 TAT,真是刷题计划深似海,从此AC是路人- - 本来2632是道略微恶心点的模拟,但毕竟是模拟,一般模拟都是仅仅要演示样例过了基本就AC了.但这个题非常特殊 我開始的时候一直跑不出測试演示样例.才发现题目中的插图和我构想的坐标系是不一样的(看来还不能轻易忽视掉插图啊) watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvY29kZWh5cG…
Crossword Answers Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 869   Accepted: 405 Description A crossword puzzle consists of a rectangular grid of black and white squares and two lists of definitions (or descriptions). One list of de…
http://poj.org/problem?id=2632 #include<cstdio> #include <cstring> #include <algorithm> using namespace std; int A,B,n,m; int robot[101][3]; char rbuff[10]; int dir[255]; const int dx[4]={0,1,0,-1}; const int dy[4]={1,0,-1,0}; int action…
题意:如果要切断一个长度为a的木条需要花费代价a, 问要切出要求的n个木条所需的最小代价. 思路:模拟huffman树,每次选取最小的两个数加入结果,再将这两个数的和加入队列. 注意priority_queue的用法,原型: priority_queue<Type> q; priority_queue<Type,deque<Type>,Comp> q; 其中Type是类型,Comp是比较结构体,比较函数是它的括号重载,比如对int型从小到大排序的Comp结构体如下: s…
题意: 就是数位哈密顿回路 解析: 是就算了...尼玛还不能直接用dfs,得手动开栈模拟dfs emm...看了老大半天才看的一知半解 #include <iostream> #include <cstdio> #include <sstream> #include <cstring> #include <map> #include <cctype> #include <set> #include <vector&g…