栈||队列
文章平均质量分 85
非常可乐(이녕)
贵在自知,贵在坚持
展开
-
杭电1022 Train Problem I
#include#includeint main(){int n,i,j,k,l,p[100];//在哪定义都一样, char m[100],s1[100],s2[100];while(scanf("%d",&n)!=EOF){scanf("%s%s",s1,s2);memset(p,0,sizeof(p));//int i,j,k,l;k=i=l=-1转载 2015-04-06 15:46:55 · 438 阅读 · 0 评论 -
NYOJ 128 前缀式计算【栈】
前缀式计算时间限制:1000 ms | 内存限制:65535 KB难度:3描述先说明一下什么是中缀式:如2+(3+4)*5这种我们最常见的式子就是中缀式。而把中缀式按运算顺序加上括号就是:(2+((3+4)*5))然后把运算符写到括号前面就是+(2 *( +(3 4) 5) )把括号去掉就是:+ 2 * + 3 4 5原创 2016-07-19 14:48:40 · 374 阅读 · 0 评论 -
NYOJ 467 中缀式变后缀式【栈】
中缀式变后缀式时间限制:1000 ms | 内存限制:65535 KB难度:3描述人们的日常习惯是把算术表达式写成中缀式,但对于机器来说更“习惯于”后缀式,关于算术表达式的中缀式和后缀式的论述一般的数据结构书都有相关内容可供参看,这里不再赘述,现在你的任务是将中缀式变为后缀式。输入第一行输入一个整数n,共有n组测试数据(n每组测试数据只有一行,是原创 2016-07-18 21:39:42 · 363 阅读 · 0 评论 -
NYOJ 35 表达式求值【栈】
表达式求值时间限制:3000 ms | 内存限制:65535 KB难度:4描述ACM队的mdd想做一个计算器,但是,他要做的不仅仅是一计算一个A+B的计算器,他想实现随便输入一个表达式都能求出它的值的计算器,现在请你帮助他来实现这个计算器吧。比如输入:“1+2/4=”,程序就输出1.50(结果保留两位小数)输入第一行输入一个整数n,共有n组测试数原创 2016-07-18 15:22:03 · 382 阅读 · 0 评论 -
codeforces 651B Beautiful Paintings【优先队列】
B. Beautiful Paintingstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n pictures delivered for th原创 2016-03-08 17:32:41 · 372 阅读 · 0 评论 -
HDOJ 5289 Assignment 【RMQ 二分 || 单调队列】
AssignmentTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2894 Accepted Submission(s): 1350Problem DescriptionTom owns a comp原创 2015-12-05 22:21:35 · 356 阅读 · 0 评论 -
POJ 3250 Bad Hair Day 【单调栈】
Bad Hair DayTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 15952 Accepted: 5387DescriptionSome of Farmer John's N cows (1 ≤ N ≤ 80,000) are having a ba原创 2015-11-15 18:22:43 · 477 阅读 · 0 评论 -
hd3152 Obstacle Course
Obstacle CourseTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 269 Accepted Submission(s): 164Problem DescriptionYou are work原创 2015-08-01 00:05:21 · 383 阅读 · 0 评论 -
杭电1242 Rescue
RescueTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 20846 Accepted Submission(s): 7446Problem DescriptionAngel was caught by the原创 2015-07-31 23:39:33 · 369 阅读 · 0 评论 -
hd1372 Knight Moves
Knight MovesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8349 Accepted Submission(s): 4910Problem DescriptionA friend of you is原创 2015-07-30 00:42:16 · 628 阅读 · 0 评论 -
poj3253 Fence Repair
Fence RepairTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 32257 Accepted: 10372DescriptionFarmer John wants to repair a small length of the fence arou原创 2015-07-29 20:39:09 · 330 阅读 · 0 评论 -
hd1509 Windows Message Queue
Windows Message QueueTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4461 Accepted Submission(s): 1777Problem DescriptionMessage qu原创 2015-07-28 23:51:35 · 468 阅读 · 0 评论 -
杭电1896 Stones
StonesTime Limit: 5000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 1396 Accepted Submission(s): 873Problem DescriptionBecause of the wrong statu原创 2015-07-29 00:13:53 · 402 阅读 · 0 评论 -
杭电4006 The kth great number
The kth great numberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 8343 Accepted Submission(s): 3292Problem DescriptionXiao Ming a原创 2015-07-29 00:22:50 · 364 阅读 · 0 评论 -
杭电1873 看病要排队
看病要排队Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6012 Accepted Submission(s): 2474Problem Description看病要排队这个是地球人都知道的常识。不过经过细心原创 2015-07-28 23:59:47 · 420 阅读 · 0 评论 -
nyoj 括号配对问题
括号配对问题时间限制:3000 ms | 内存限制:65535 KB难度:3描述 现在,有一行括号序列,请你检查这行括号是否配对。输入第一行输入一个数N(0输出每组输入数据的输出占一行,如果该字符串中所含的括号是配对的,则输出Yes,如果不配对则输出No样例输入3[(])(])([[]()])样例输出NoNoYes嗯,原创 2015-07-27 10:47:57 · 373 阅读 · 0 评论 -
Seinfeld杭电3351
I’m out of stories. For years I’ve been writing stories, some rather silly, just to make simple problems look difficult and complex problems look easy. But, alas, not for this one.You’re given a non原创 2015-04-14 22:46:24 · 788 阅读 · 0 评论 -
PAT(甲级)1017. Queueing at Bank (25)
Queueing at Bank (25)Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the customers have to wait in line原创 2018-01-26 18:57:36 · 354 阅读 · 0 评论