20150328

Written by  on March 28, 2015

下午在面包店选好了作为晚餐的面包,店员背对着我拿着我的面包准备去前台结帐,我摸了摸口袋发现没有带钱包就下意识地说了一句等一下,结果话音未落店员就来了一句没事你可以明天再给钱(期间一直背对着我啊!),真是少林寺扫地高僧即视感,不过后来我还是在口袋里面翻出了一点零钱结了帐。

[Read more...]

POJ2663

Written by  on March 27, 2015

POJ2663 Tri Tiling Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8737 Accepted: 4554 Description In how many ways can you tile a 3xn rectangle with 2×1 dominoes?

[Read more...]

20150327

Written by  on March 27, 2015

还没打上1700分就又掉了啊。。。 还掉的这么惨,1900+ Rank啊 Orz 其实事后把题目全部做一遍,感觉这一次理应A三道题的,还是差那么一点点啊~

[Read more...]

UVAOJ11198

Written by  on March 26, 2015

UVA11198 Rujia Liu的神题啊,虽然AC率有40%,但是AC的人数只有两三百个。。随便搞一搞就前150了 Orz。。。 题意就是给一个序列,只有当两个元素异号且绝对值之和是质数才可以移动到彼此的左右边,即ai可以移动到aj的左边或者右边,aj也可以移动到ai的左边或者右边,问最少移动多少次就可以使整个序列递增排列。

[Read more...]

Codeforces #527 C

Written by  on March 19, 2015

527C C. Glass Carving time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Leonid wants to become a glass carver (the person who creates beautiful artworks by cutting the glass). He already has a rectangular wmm  ×  h mm sheet of glass, a diamond glass cutter and lots of enthusiasm. What he lacks is understanding of what to carve and how.

[Read more...]

UVAOJ10001

Written by  on March 17, 2015

UVAOJ10001 Great thanks to: 孟海 难点不在算法,在题意。 题目给一个字符串,然后求是否有一个字符串能够通过题目所给的自动机规则变换过来,如果存在,则输出REACHABLE,否则输出GARDEN OF EDEN,就是寓意始祖,即这个字符串无法通过所给的自动及变换规则变换过来。

[Read more...]

乔姆斯基谱系

Written by  on March 16, 2015

最近一两周编译原理课上面都是讲乔姆斯基谱系,也就是通常所说的0型文法,1型文法,2型文法以及3型文法,课上老师重点讲了2型文法,也就是上下文无关文法,对于其他几种文法提的不多,龙书上面也只讲了上下文无关文法(其他的几种文法提都没有提),课上感觉理解的还是很抽象,所以在这里再好好整理一下网上搜索到的相关概念。

[Read more...]

Pure Pursuing

Written by  on March 15, 2015

Exercise for TOEFL Writing It is still in my mind there are so many times that I have sweared to my mom I would get what a good grades in the exam, and every time I would ask for her promise about what I could get if I made it, I also remember that rarely had I finally done with it. Honestly, I feel shameful and guilty about it.

[Read more...]

AOAPC I: Volume 3.Brute Force-Backtracking:Easy

Written by  on March 15, 2015

<<算法竞赛入门经典>> UVaoj第四卷暴力求解简单回溯习题: 10474-Where is the Marble? 之前的习题卷里面也收录了这个习题,输入N个数, 然后再输入要查找的Q个数, 依次输出Q个数中每个数在N个数中被找到的位置, 找不到就not found.

[Read more...]

UVAOJ208

Written by  on March 15, 2015

UVAOJ208 这题隐藏的真深啊,看起来这么单纯可爱的一道DFS我居然TLE了两次。。。 我果然还是太naive了。。。 总而言之,虽然数据范围很小,但是依旧需要剪枝,在DFS之前首先要预处理一下,排除掉无法抵达终点的点,只用从终点开始反过来DFS遍历即可。

[Read more...]