北大poj- 1028】的更多相关文章

原文地址:北大POJ题库使用指南 北大ACM题分类主流算法: 1.搜索 //回溯 2.DP(动态规划)//记忆化搜索 3.贪心 4.图论 //最短路径.最小生成树.网络流 5.数论 //组合数学(排列组合).递推关系.质因数法 6.计算几何 //凸壳.同等安置矩形的并的面积与周长.凸包计算问题 8.模拟 9.数据结构 //并查集.堆.树形结构 10.博弈论 11.CD有正气法题目分类: 1. 排序 1423, 1694, 1723, 1727, 1763, 1788, 1828, 1838, 1…
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…
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 测试样例: 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…
#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…
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.…
考查代码能力的题目.也能够说是算法水题,呵呵. 推荐新手练习代码能力. 要添加难度就使用纯C实现一下stack,那么就有点难度了,能够使用数组模拟环形栈.做多了,我就直接使用STL了. #include <stdio.h> #include <iostream> #include <stack> #include <string> using namespace std; int main() { stack<string> forward; s…
#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…
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…