![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构编程实验05
smaracoon
这个作者很懒,什么都没留下…
展开
-
POJ1363 ZOJ1259 Rails PopPush
//5_2_1: Rails PopPush城火车站出入组合问题 POJ1363 ZOJ1259 #include #include #include using namespace std; const int maxn = 1000 + 10; int main() { int i,x,N,max,cnt,valid,p[maxn]; cin >> N; while(N) {原创 2015-04-11 16:47:02 · 213 阅读 · 0 评论 -
POJ3044 City Skyline
//5_4_4: City Skyline 根据楼的叠加效果求楼的数量 POJ3044 #include #include #include using namespace std; const int maxn = 50000 + 10; const int maxh = 25000 + 10; int main() { int i,x,N,W,top = 0,cnt = 0,a[max原创 2015-04-16 10:43:24 · 204 阅读 · 0 评论 -
POJ1012 Joseph
//5_4_3: Joseph k个好人和坏人判断步长问题 POJ1012 #include #include #include using namespace std; int main() { int i,k,m,n,s,t,flag,ans[15]; for(k = 1;k <= 13;k ++) { i = 1; n = 2 * k; s = t = flag =原创 2015-04-15 20:32:55 · 160 阅读 · 0 评论 -
POJ1591 ZOJ1326 M*A*S*H
//5_4_2: M*A*S*H 通过卡片数字去掉人员 POJ1591 ZOJ1326 #include #include #include using namespace std; int main() { int i,j,k,N,X,cnt,max,a[25],tag[55],loop = 1; while(scanf("%d",&N) != EOF) { scanf("%d"原创 2015-04-14 15:07:33 · 369 阅读 · 0 评论 -
POJ3125 Printer Queue
//5_3_3: Printer Queue 打印机优先队列问题 POJ3125 #include #include #include using namespace std; const int maxn = 100 + 5; int main() { int i,n,m,k,a[maxn],cnt,tag,head,rear,loop,print; scanf("%d",&loop)原创 2015-04-13 23:43:49 · 167 阅读 · 0 评论 -
POJ2259 ZOJ1948 Team Queue
//5_3_2: Team Queue 团队队列的基本操作 POJ2259 ZOJ1948 #include #include #include using namespace std; const int maxn = 1000000 + 10; //总的元素个数 const int maxb = 200000 + 10; //总的子队列数 const int maxs = 1000原创 2015-04-13 17:23:55 · 237 阅读 · 0 评论 -
ZOJ3210 A Stack or A Queue
//5_3_1: A Stack or A Queue 判断是栈还是队列 ZOJ3210 #include #include #include using namespace std; const int maxn = 100 + 10; int main() { int i,x,N,loop,a[maxn],isstack,isqueue; cin >> loop; while(lo原创 2015-04-12 16:14:52 · 230 阅读 · 0 评论 -
POJ2106 ZOJ2483 Boolean Expressions
//5_2_2: Boolean Expressions 布尔表达式求值 POJ2106 ZOJ2483 #include #include #include using namespace std; /***********优先级比较***********/ /*-----------------------------*/ /* '(' | '|' | '&' | '!' | ')' *原创 2015-04-12 15:57:34 · 643 阅读 · 0 评论 -
POJ3750 小孩报数问题
//5_1_1: 小孩报数问题,即约瑟夫问题 POJ3750 #include #include #include using namespace std; int main() { short i,N,w,s,cnt = 1,tag[64] = {0}; char c,name[64][15]; cin >> N; for(i = 0;i > name[i]; cin >> w原创 2015-04-11 11:13:39 · 243 阅读 · 0 评论 -
ZOJ1004 Anagrams by Stack
//5_4_5: Anagrams by Stack 通过一系列栈操作将字符翻转 ZOJ1004 #include #include #include using namespace std; int i,len,top,str_len,dst_len; char str[100],dst[100],ans[100],stack[100]; void dfs(int x,int y) {原创 2015-04-16 17:17:50 · 148 阅读 · 0 评论