zhber
有好多做过的题没写下来,如果我还能记得就补吧

随笔分类 -  栈/队列/链表

cf287E Main Sequence
摘要:As you know, Vova has recently become a new shaman in the city of Ultima Thule. So, he has received the shaman knowledge about the correct bracket seq 阅读全文
posted @ 2017-08-04 10:41 zhber 阅读(216) 评论(0) 推荐(0)
cf670E Correct Bracket Sequence Editor
摘要:Recently Polycarp started to develop a text editor that works only with correct bracket sequences (abbreviated as CBS). Note that a bracket sequence i 阅读全文
posted @ 2017-07-15 12:43 zhber 阅读(317) 评论(0) 推荐(0)
cf575A Fibonotci
摘要:Fibonotci sequence is an integer recursive sequence defined by the recurrence relation Fn = sn - 1·Fn - 1 + sn - 2·Fn - 2withF0 = 0, F1 = 1 Sequence s 阅读全文
posted @ 2017-07-14 22:13 zhber 阅读(813) 评论(0) 推荐(0)
Spoj-VISIBLEBOX Decreasing Number of Visible Box
摘要:Shadowman loves to collect box but his roommates woogieman and itman don't like box and so shadowman wants to hide boxes as many as possible. A box ca 阅读全文
posted @ 2017-07-12 00:20 zhber 阅读(225) 评论(0) 推荐(0)
Spoj-DRUIDEOI Fata7y Ya Warda!
摘要:Fata7y Ya Warda! Druid (AKA Amr Alaa El-Deen) and little EOIers have finished their training and they are playing "Fatta7y ya warda!". It's a kids gam 阅读全文
posted @ 2017-07-11 22:15 zhber 阅读(175) 评论(0) 推荐(0)
bzoj3039 玉蟾宫
摘要:Description有一天,小猫rainbow和freda来到了湘西张家界的天门山玉蟾宫,玉蟾宫宫主蓝兔盛情地款待了它们,并赐予它们一片土地。这片土地被分成N*M个格子,每个格子里写着'R'或者'F',R代表这块土地被赐予了rainbow,F代表这块土地被赐予了freda。现在freda要在这里卖... 阅读全文
posted @ 2014-12-02 10:56 zhber 阅读(203) 评论(0) 推荐(0)
bzoj1483 [HNOI2009]梦幻布丁
摘要:DescriptionN个布丁摆成一行,进行M次操作.每次将某个颜色的布丁全部变成另一种颜色的,然后再询问当前一共有多少段颜色.例如颜色分别为1,2,2,1的四个布丁一共有3段颜色.Input第一行给出N,M表示布丁的个数和好友的操作次数. 第二行N个数A1,A2...An表示第i个布丁的颜色从第三... 阅读全文
posted @ 2014-08-05 21:56 zhber 阅读(232) 评论(0) 推荐(0)
bzoj1628 [Usaco2007 Demo]City skyline
摘要:DescriptionThe best part of the day for Farmer John's cows is when the sun sets. They can see the skyline of the distant city. Bessie wonders how many... 阅读全文
posted @ 2014-07-25 22:10 zhber 阅读(198) 评论(0) 推荐(0)
bzoj1657 [Usaco2006 Mar]Mooo 奶牛的歌声
摘要:DescriptionFarmer John's N (1 #include#define N 50001inline int max(int a,int b){return a>b?a:b;}inline int read(){ int x=0,f=1;char ch=getchar(); ... 阅读全文
posted @ 2014-07-20 23:15 zhber 阅读(197) 评论(0) 推荐(0)
cf442C Artem and Array
摘要:C. Artem and Arraytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputArtem has an array ofnpositive... 阅读全文
posted @ 2014-06-20 17:34 zhber 阅读(250) 评论(0) 推荐(0)
bzoj3401[Usaco2009 Mar]Look Up 仰望
摘要:Description约翰的N(1≤N≤105)头奶牛站成一排,奶牛i的身高是Hi(l≤Hi≤1,000,000).现在,每只奶牛都在向左看齐.对于奶牛i,如果奶牛j满足i#includeusing namespace std;inline int read(){ int x=0,f=1;ch... 阅读全文
posted @ 2014-06-17 23:28 zhber 阅读(181) 评论(0) 推荐(0)
bzoj3403[Usaco2009 Open]Cow Line 直线上的牛
摘要:Description题目描述约翰的N只奶牛(编为1到N号)正在直线上排队.直线上开始的时候一只牛也没有.接下来发生了S(1≤S≤100000)次事件,一次事件可能是以下四种情况之一:.一只奶牛加入队伍的左边(输入“AL”)..一只奶牛加入队伍的右边(输入“AR”).·K只队伍左边奶牛离开(输入“D... 阅读全文
posted @ 2014-06-14 21:30 zhber 阅读(166) 评论(0) 推荐(0)
bzoj1660[Usaco2006 Nov]Bad Hair Day 乱发节
摘要:DescriptionInput* Line 1: 牛的数量 N。* Lines 2..N+1: 第 i+1 是一个整数,表示第i头牛的高度。Output* Line 1: 一个整数表示c[1] 至 c[N]的和。Sample Input610374122输入解释:六头牛排成一排,高度依次是 10,... 阅读全文
posted @ 2014-06-07 00:15 zhber 阅读(152) 评论(0) 推荐(0)
bzoj1113[Poi2008]海报PLA
摘要:DescriptionN个矩形,排成一排. 现在希望用尽量少的矩形海报Cover住它们.Input第一行给出数字N,代表有N个矩形.N在[1,250000] 下面N行,每行给出矩形的长与宽.其值在[1,1000000000]2 1/2 PosteringOutput最少数量的海报数.Sample I... 阅读全文
posted @ 2014-06-05 13:19 zhber 阅读(154) 评论(0) 推荐(0)
bzoj1012[JSOI2008]最大数maxnumber
摘要:Description现在请求你维护一个数列,要求提供以下两种操作: 1、 查询操作。语法:Q L 功能:查询当前数列中末尾L个数中的最大的数,并输出这个数的值。限制:L不超过当前数列的长度。 2、 插入操作。语法:A n 功能:将n加上t,其中t是最近一次查询操作的答案(如果还未执行过查询操作,则... 阅读全文
posted @ 2014-06-03 21:57 zhber 阅读(461) 评论(0) 推荐(0)
bzoj1007 [HNOI2008]水平可见直线
摘要:1007: [HNOI2008]水平可见直线Time Limit:1 SecMemory Limit:162 MBSubmit:3099Solved:1128[Submit][Status]DescriptionInput第一行为N(0 #include#include#include#includ... 阅读全文
posted @ 2014-06-01 00:02 zhber 阅读(169) 评论(0) 推荐(0)