卜算子 答施

樂婉

相思似海深
舊事如天遠
淚滴千千萬萬行
更使人
愁斷腸

要見無因見
拚了終難拚
若是前生未有緣
待重結
來生願

当我登上那古老的城墙,当我抚摸着腐朽的柱梁,当我兴奋的倚栏远望,总会有一丝酸涩冲上喉头,总听到有一个声音大声的说:记得吗?你的祖先名叫炎黄。 书上说有一条大鱼,生活在北冥那个地方,它化作一只巨鸟,在天地之间翱翔。巨鸟有如垂天之云般的翅膀,虽九万里亦可扶摇直上。圣贤赋予我们可以囊括天宇的胸襟,为我们塑造一个博大恢弘的殿堂。 那时候,有个怪异的青年名叫嵇康,他临刑前,弹奏了一曲绝响,那宽袍博带在风中飞扬,他用了最优雅的姿态面对死亡。几千年过去,依旧有余音绕梁,只是他不知道,真正断绝的不是曲谱,而是他的傲骨,乃至他身上的衣裳。 我也曾梦回大唐,和一个叫李白的诗人云游四方,他用来下酒的是剑锋上的寒光,他的情人是空中的月亮。我曾见他在月下徘徊、高歌吟唱,长风吹开他的发带,长袍飘逸宛如仙人模样。 可是后来换了帝王,他用一杯酒捧起了文人,摒弃了武将。他的子孙最终躲进人间天堂,把大片的土地拱手相让。然而在寒冷的北方,正有一支军队征战沙场,敌人都说,有岳家军在,我们打不了胜仗。可叹英雄遭忌,谗士高张,一缕忠魂终于消散在西湖之傍,一个民族的精神就这么无可逆转的消亡。然而血色夕阳中,我依稀见到,有人把它插进土壤,那是将军用过的,一支宁折不弯的缨枪。 时间的车轮悠悠荡荡,终于在甲申那里失了方向。于是瘦西湖畔,梅花岭上,为纪念这个悲剧建起一座祠堂。那个叫史可法的文弱书生,他不愿散开高束的发髻,更不能脱去祖先留给他的衣裳,于是他决定与城共存共亡,丢了性命,护了信仰。残酷的杀戮,如山的尸骨,并不能把民族的精神埋葬,有人相信,终有一天,它还会在中华大地上熠熠发光。 几百年后,我坐进麦当劳的厅堂,我穿起古奇牌的时装,我随口唱着 my heart will go on,却莫名其妙的心伤,因为我听到一个声音大声的说:忘了吗?你的祖先名叫炎黄。 我记得了,一群褐发篮眼的豺狼,带着坚船利炮,拆了我们的庙宇,毁了我们的殿堂。于是在历经无数灾难之后的今天 —— 我们懂得民主自由,却忘了伦理纲常,我们拥有音乐神童,却不识角徵宫商,我们能建起高楼大厦,却容不下一块公德牌坊,我们穿着西服革履,却没了自己的衣裳。 在哪里,那个礼仪之邦?在哪里,我的汉家儿郎? 为什么我穿起最美丽的衣衫,你却说我行为异常?为什么我倍加珍惜的汉装,你竟说它属于扶桑?为什么我真诚的告白,你总当它是笑话一场?为什么我淌下的热泪,丝毫都打动不了你的铁石心肠? 在哪里,那个信义之乡?在哪里,我的汉家儿郎? 我不愿为此痛断肝肠,不愿祖先的智慧无人叹赏,更不愿我华夏衣冠留落异邦。所以心中总有一个渴望,梦想有一天,我们可以拾起自己的文化,撑起民族的脊梁。 记住吧,记住吧,有一个时代叫汉唐,有一条河流叫长江,有一对图腾叫龙凤,有一件羽衣 —— 名叫霓裳!

南鄉子 自述

蘇軾

凉簟碧紗廚。一枕清風晝睡餘。睡聽晚衙無一事,徐徐,讀盡牀頭幾卷書。
搔首賦歸歟。自覺功名懶更疏。若問使君才與術,何如,占得人間一味愚。

男儿何不带吴钩
收取关山五十州
### 流水账,记录下一些大事的时间 | 时间 | 事务 | | --------------------- | -------------- | | 9月26日 9:30——14:30 | 南京南——秦皇岛 | | 9月27日 14:00——15:00 | 比赛开幕式 | | 9月27日 15:00——17:00 | 热身赛 | | 9月28日 9:10——14:10 | 正式比赛 | | 9月28日 15:00——16:00| 颁奖仪式暨闭幕式 | | 9月29日 8:02——12:15 | 秦皇岛——北京 | | 9月29日 13:00——14:30 | 游天坛 | | 9月29日 16:15——21:43| 北京南——南京南 |

启程

获得名额

七场激烈的网络赛尘埃落定,team002 (到目前为止)获得了 1+1 场比赛机会。在比赛还未结束时,我们差不多已把握了 CCPC 秦皇岛赛区的名额。秦皇岛赛区是时间较早的一个赛区, 暑假完后不到一个月就已开始,我们队因为自己还未充分准备,想多补补题,做做题目,加之比赛需要我们请假四天,大三课程紧张,四天要旷课许多,我们队便有了想换赛区的想法,改为 CCPC 桂林站或者是两场 ICPC 比赛。但和老板沟通后,因为如果我们赛区改动,别的队伍将来不及安排,于是我们队选择大橘为重,擎南邮之帜,以 “以上队伍成绩无效” 之名,进军秦皇岛。

阅读全文 »

   致疯狂的人。他们特立独行。他们桀骜不驯。他们惹是生非。他们格格不入。他们用与众不同的眼光看待事物。他们不喜欢墨守成规。他们也不愿安于现状。你可以认同他们,反对他们,颂扬或是诋毁他们。但唯独不能漠视他们。因为他们改变了寻常事物。他们推动人类向前迈进。或许他们是别人眼里的疯子,但他们却是我们眼中的天才。因为只有那些疯狂到以为自己能够改变世界的人…… 才能真正改变世界。

最近又好颓废呀,暑假想写的两道树状数组的题解拖到了今天。

Movie Collection(NWERC 2011)

传送门: Gym - 100729C

Problem

Description

Mr. K. I. has a very big movie collection. He has organized his collection in a big stack.
Whenever he wants to watch one of the movies, he locates the movie in this stack and removes
it carefully, ensuring that the stack doesn’t fall over. After he finishes watching the movie, he
places it at the top of the stack.
Since the stack of movies is so big, he needs to keep track of the position of each movie.
It is sufficient to know for each movie how many movies are placed above it, since, with this
information, its position in the stack can be calculated. Each movie is identified by a number
printed on the movie box.
Your task is to implement a program which will keep track of the position of each movie.
In particular, each time Mr. K. I. removes a movie box from the stack, your program should
print the number of movies that were placed above it before it was removed.

阅读全文 »

尺取法、单调队列、滑动窗口一直傻傻分不清。以前觉得尺取法就是滑动窗口,现在又觉得单调队列和滑动窗口是一回事。

算法的美妙之处就在于当你明了一个算法时,会发自内心惊叹它的美。我于树状数组如此,学习单调队列后亦如此。

关于单调队列的用法主要看了下单调队列及其应用中的内容, 以下引用一些内容。

单调队列及其应用

单调队列,望文生义,就是指队列中的元素是单调的。如:{a1,a2,a3,a4……an}满足a1<=a2<=a3……<=an,a序列便是单调递增序列。同理递减队列也是存在的。

单调队列的出现可以简化问题,队首元素便是最大(小)值,这样,选取最大(小)值的复杂度便为o(1),由于队列的性质,每个元素入队一次,出队一次,维护队列的复杂度均摊下来便是o(1)。

如何维护单调队列呢,以单调递增序列为例:

1、如果队列的长度一定,先判断队首元素是否在规定范围内,如果超范围则增长队首。

2、每次加入元素时和队尾比较,如果当前元素小于队尾且队列非空,则减小尾指针,队尾元素依次出队,直到满足队列的调性为止

要特别注意头指针和尾指针的应用。

阅读全文 »

传送门:Northeastern European Regional Contest 2011 E. Eve

Problem

Input file: eve.in
Output file: eve.out

Mitochondrial DNA is the Deoxyribonucleic acid molecule that is contained in mitochondria within cellsof an organism. Mitochondrial DNA is normally passed to a child exclusively from its mother. Because of this fact, it is possible to speak of “Mitochondrial Eve” which refers to the most recent common matrilineal ancestor of the entire population. Matrilineal ancestry is traced through female line: mother, grandmother, etc. Mitochondrial Eve of the Earth’s human population is estimated to have lived around 200 000 years ago, most likely in the East Africa.![](https://www.lifeofpix.com/wp-content/uploads/2018/04/IMG_4475-1600x900.jpg)
阅读全文 »

传送门:LightOJ 1269..Consecutive Sum

Problem

Description

Little Jimmy is learning how to add integers. As in decimal the digits are 0 to 9, it makes a bit hard for him to understand the summation of all pair of digits. Since addition of numbers requires the knowledge of adding digits. So, his mother gave him a software that can convert a decimal integer to its binary and a binary to its corresponding decimal. So, Jimmy’s idea is to convert the numbers into binaries, and then he adds them and turns the result back to decimal using the software. It’s easy to add in binary, since you only need to know how to add (0, 0), (0, 1), (1, 0), (1, 1). Jimmy doesn’t have the idea of carry operation, so he thinks that

1 + 1 = 0

1 + 0 = 1

0 + 1 = 1

0 + 0 = 0

Using these operations, he adds the numbers in binary. So, according to his calculations,

3 (011) + 7 (111) = 4 (100)

Now you are given an array of n integers, indexed from 0 to n-1, you have to find two indices i j in the array (0 ≤ i ≤ j < n), such that the summation (according to Jimmy) of all integers between indices i and j in the array, is maximum. And you also have to find two indices, p q in the array (0 ≤ p ≤ q < n), such that the summation (according to Jimmy) of all integers between indices p and q in the array, is minimum. You only have to report the maximum and minimum integers.

Input

Input starts with an integer **T (**≤ 10), denoting the number of test cases.

Each case starts with a line containing an integer n (1 ≤ n ≤ 50000). The next line contains n space separated non-negative integers, denoting the integers of the given array. Each integer fits into a 32 bit signed integer.

Output

For each case, print the case number, the maximum and minimum summation that can be made using Jimmy’s addition.

Sample Input

2

5

6 8 2 4 2

5

3 8 2 6 5

Sample Output

Case 1: 14 2

Case 2: 15 1

Note

Dataset is huge, use faster I/O methods.

Solution

0%