POJ 1028题目描述】的更多相关文章

Description Standard web browsers contain features to move backward and forward among the pages recently visited. One way to implement these features is to use two stacks to keep track of the pages that can be reached by moving backward and forward.…
Description You, as a member of a development team for a new spell checking program, are to write a module that will check the correctness of given words using a known dictionary of all correct words in all their forms. If the word is absent in the d…
此文转载别人,希望自己能够做完这些题目! 1.POJ动态规划题目列表 容易:1018, 1050, 1083, 1088, 1125, 1143, 1157, 1163, 1178, 1179, 1189, 1208, 1276,1322, 1414, 1456, 1458, 1609, 1644, 1664, 1690, 1699, 1740(博弈),1742, 1887, 1926(马尔科夫矩阵,求平衡), 1936, 1952, 1953, 1958, 1959, 1962, 1975,…
]POJ 动态规划题目列表 容易: 1018, 1050, 1083, 1088, 1125, 1143, 1157, 1163, 1178, 1179, 1189, 1208, 1276, 1322, 1414, 1456, 1458, 1609, 1644, 1664, 1690, 1699, 1740(博弈), 1742, 1887, 1926(马尔科夫矩阵,求平 衡), 1936,1952, 1953, 1958, 1959, 1962, 1975, 1989, 2018, 2029,2…
http://poj.org/problem?id=1028 题意(水):做一个游览器的历史记录. back:后退到上一个页面,当上一个页面没有时,输出ignored. forward:向前一个页面,但此页面为最前的页面时,输出ignored. vista:游览所指定的页面. quit:退出. 解题思路:题目是说用栈,但不用栈也是可以的.就用纯数组来模拟就栈. 我用的是string类型,这个类型有个好处,就是比较不用strcmp函数,还有输入方便,直接cin就行.但其实本质就是char[]; #…
题目链接:http://poj.org/problem? id=1028 Description Standard web browsers contain features to move backward and forward among the pages recently visited. One way to implement these features is to use two stacks to keep track of the pages that can be rea…
题目地址:http://poj.org/problem?id=1028 测试样例: Sample Input VISIT http://acm.ashland.edu/ VISIT http://acm.baylor.edu/acmicpc/ BACK BACK BACK FORWARD VISIT http://www.ibm.com/ BACK BACK FORWARD FORWARD FORWARD QUIT Sample Output http://acm.ashland.edu/ ht…
动态规划与贪心相关: {HDU}{4739}{Zhuge Liang's Mines}{压缩DP} 题意:给定20个点坐标,求最多有多少个不相交(点也不相交)的正方形 思路:背包问题,求出所有的正方形,然后求最多有多少个正方形不互相覆盖,这题真是神思路. {POJ}{3846}{Mountain Road} 题意:给定两个地点车的班次,路是双向单车道,求安排最短的时间 思路:对车次序列进行二维DP转移,转移的时候需要注意时刻的维护.这个题目的DP思路是正向DP,每次遍历到f[i][j]都需要更新…
Web Navigation Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 31088   Accepted: 13933 Description Standard web browsers contain features to move backward and forward among the pages recently visited. One way to implement these features…
列表一:经典题目题号:容易: 1018, 1050, 1083, 1088, 1125, 1143, 1157, 1163, 1178, 1179, 1189, 1191,1208, 1276, 1322, 1414, 1456, 1458, 1609, 1644, 1664, 1690, 1699, 1740, 1742, 1887, 1926, 1936, 1952, 1953, 1958, 1959, 1962, 1975, 1989, 2018, 2029, 2039, 2063, 20…
考查代码能力的题目.也能够说是算法水题,呵呵. 推荐新手练习代码能力. 要添加难度就使用纯C实现一下stack,那么就有点难度了,能够使用数组模拟环形栈.做多了,我就直接使用STL了. #include <stdio.h> #include <iostream> #include <stack> #include <string> using namespace std; int main() { stack<string> forward; s…
题目实在是太难懂了,我翻译了一下... STAMPS Description Have you done any Philately lately? 你最近有没有集邮? You have been hired by the Ruritanian Postal Service (RPS) to design their new postage software. The software allocates stamps to customers based on customer needs a…
时间限制:1秒     空间限制:32768k 斐波那契数列指的是这样一个数列: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368. 可以观察到,从第3个数开始,每个数的值都等于前连个数之和. 同时,定义f(0)=0, f(1)=1. 则 f(2)=f(1)+f(0)=1; f(3)=f(2)+f(1)=2; ... 依次类推,  f(…
Description From the article Number Theory in the 1994 Microsoft Encarta: ``If a, b, c are integers such that a = bc, a is called a multiple of b or of c, and b or c is called a divisor or factor of a. If c is not 1/-1, b is called a proper divisor o…
Description Little Johnny has got a new car. He decided to drive around the town to visit his friends. Johnny wanted to visit all his friends, but there was many of them. In each street he had one friend. He started thinking how to make his trip as s…
Description The GX Light Pipeline Company started to prepare bent pipes for the new transgalactic light pipeline. During the design phase of the new pipe shape the company ran into the problem of determining how far the light can reach inside each co…
Description New convocation of The Fool Land's Parliament consists of N delegates. According to the present regulation delegates should be divided into disjoint groups of different sizes and every day each group has to send one delegate to the concil…
#include <iostream>#include <cstdio>#include <cmath>#include <stack>#include <string> using namespace std; int main(){ char command[16]; char url[71]; stack<string> forwardStack; stack<string> backStack; string cu…
Given any integer 0 ≤ n ≤ 10000 not divisibleby 2 or 5, some multiple of n is a number whichin decimal notation is a sequence of 1’s. Howmany digits are in the smallest such a multipleof n?InputA file of integers at one integer per line.OutputEach out…
#include<stdio.h> #include<string.h> int main() { ][]; ]; int i,depth; strcpy(s[],"http://www.acm.org/"); i=; depth=; ) { scanf("%s",str); ) { break; } ) { scanf("%s",&s[++i]); printf("%s\n",s[i]); d…
Eugeny has array a = a1, a2, ..., an, consisting of n integers. Each integer ai equals to -1, or to 1. Also, he has m queries: Query number i is given as a pair of integers li, ri (1 ≤ li ≤ ri ≤ n). The response to the query will be integer 1, if the…
Web Navigation Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 30828   Accepted: 13821 Description Standard web browsers contain features to move backward and forward among the pages recently visited. One way to implement these features…
MinStack minStack = new MinStack();minStack.push(-2);minStack.push(0);minStack.push(-3);minStack.getMin(); --> 返回 -3.minStack.pop();minStack.top(); --> 返回 0.minStack.getMin(); --> 返回 -2. const minStack = function(){ this.stack = [] // 辅助栈,换更少的时间复…
[九度OJ]题目1028:继续畅通工程 解题报告 标签(空格分隔): 九度OJ 原题地址:http://ac.jobdu.com/problem.php?pid=1028 题目描述: 省政府"畅通工程"的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可).现得到城镇道路统计表,表中列出了任意两城镇间修建道路的费用,以及该道路是否已经修通的状态.现请你编写程序,计算出全省畅通需要的最低成本. 输入: 测试输入包含若干测试用例.每个测试用例…
题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1028 题目描述: Excel can sort records according to any column. Now you are supposed to imitate this function. Input Each input file contains one test case. For each case, the first line contains two inte…
Electricity POJ - 2117 题目描述 Blackouts and Dark Nights (also known as ACM++) is a company that provides electricity. The company owns several power plants, each of them supplying a small area that surrounds it. This organization brings a lot of proble…
一:线段树 线段树是一种二叉搜索树,与区间树相似,它将一个区间划分成一些单元区间,每个单元区间对应线段树中的一个叶结点.使用线段树可以快速的查找某一个节点在若干条线段中出现的次数,时间复杂度为O(log2N). 线段树的每个节点都表示一个区间[L, R],对于一个线段树的区间: 若L < R,则必能被分为[L, M]和[M+1, R],其中M = (L + R) / 2. 若L = R,则为叶子节点. 实现方法: 数组实现:节点T的左儿子是2T,代表[L, M]区间,右儿子是2T+1,代表[M+…
URAL题解一 URAL 1002 题目描述:一种记住手机号的方法就是将字母与数字对应,如图.这样就可以只记住一些单词,而不用记住数字.给出一个数字串和n个单词,用最少的单词数来代替数字串,输出对应的任一方案. solution 首先想到的应该是DP,接着就是状态转移的问题,也就是预处理出每个单词可以与哪一段的数字对应,分析时间复杂度,发现直接暴力判断是可以的,但用HASH会好一些,还可以用KMP. 时间复杂度:\(O(单词数*数字长度)或O(单词长度*数字长度)\) URAL 1010 题目描…
https://www.luogu.org/problem/show?pid=1028 题目描述 我们要求找出具有下列性质数的个数(包含输入的自然数n): 先输入一个自然数n(n<=1000),然后对此自然数按照如下方法进行处理: 1.不作任何处理; 2.在它的左边加上一个自然数,但该自然数不能超过原数的一半; 3.加上数后,继续按此规则进行处理,直到不能再加自然数为止. 输入输出格式 输入格式: 一个自然数n(n<=1000) 输出格式: 一个整数,表示具有该性质数的个数. 输入输出样例 输…
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…