1028 Web Navigation】的更多相关文章

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…
题目链接: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 题意: 模拟浏览器的前进/后退/访问/退出 的四个操作. 输出当前访问的URL或者Ignore(如果不能前进/后退). 分析:  用一个vector加上当前位置索引index即可. 当进行visit一个新的URL时, 应该基于当前URL重新建立FORWORD表(清空以前的FORWORD元素即可). 教训: 操作容器时, 如果对容器进行改变, 那么对应的size()等等也要考虑变化, 否则机会出错. #include <io…
题目地址: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…
考查代码能力的题目.也能够说是算法水题,呵呵. 推荐新手练习代码能力. 要添加难度就使用纯C实现一下stack,那么就有点难度了,能够使用数组模拟环形栈.做多了,我就直接使用STL了. #include <stdio.h> #include <iostream> #include <stack> #include <string> using namespace std; int main() { stack<string> forward; s…
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…
题目来源:http://poj.org/problem?id=1028 题目大意: 模拟实现一个浏览器的“前进”和“回退”功能.由一个forward stack和一个backward stack实现. 打开浏览器时的正位于http://www.acm.org/.然后浏览器会接受下面四种命令: BACK:将当前页面压入forward stack,将backward stack顶部页面弹出,成为当前页面.若当前backward stack为空,忽略该命令: FORWARD:将当前页面压入backwa…
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. In this prob…
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.…
这题是01年East Central North的A题,目测是签到题 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 reach…