A long-distance telephone company charges its customers by the following rules:Making a long-distance call costs a certain amount per minute, dependin...
分类:
其他好文 时间:
2015-02-27 00:15:02
阅读次数:
199
题外话最近做题发现自己非常SB,总是查一个SB错误查N久,简直绝望啊。。。弱逼为何而战这次是忘记加long long查了N久。。蛋碎无比不过好歹是又做出一道cc hard的题了呢,感人肺腑Description题意很简单:一棵树,问多少个二元组(u,v)(u , v),满足u 到 v的路径长度为素数的概率为多少。所有边长度为11Solution自从重温了下 楼教的男人八题后,这种关于路径长度的题一看...
分类:
其他好文 时间:
2015-02-24 15:10:26
阅读次数:
178
In order to crack “Vigenere Cipher” under the circumstance that the key length can be only 3, 4 or 5, I used frequency analysis to find possible keys and compared the Euclidean distance of all c...
分类:
其他好文 时间:
2015-02-17 23:52:05
阅读次数:
416
题目Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have the following 3 operations permitted on a word:a)...
分类:
其他好文 时间:
2015-02-13 19:59:56
阅读次数:
155
robocode 部分 API 中文参考ahead 向前public void ahead(double distance)Immediately moves your robot ahead (forward) by distance measured in pixels.马上将你的机器人向前移动...
分类:
编程语言 时间:
2015-02-13 14:45:47
阅读次数:
249
传送门:Cat VS Dog题意:动物园有N只猫,M只狗,P个小孩。每个小孩都有自己喜欢的动物和讨厌的动物,如果他喜欢狗,那么就讨厌猫,如果他讨厌狗,那么他就喜欢猫。某个小孩能开心,当且仅当他喜欢的动物留在动物园和讨厌的动物不在动物园里面。现让管理员通过带走某些动物,问最多能使多少个孩子开心。分析:...
分类:
其他好文 时间:
2015-02-11 23:16:06
阅读次数:
226
三道题都很类似。给出1741的代码#include#include#includeusing namespace std;#define MAXN 10001typedef pair Point;int n,K,ans;int v[MAXN<<1],w[MAXN<<1],first[MAXN],ne...
分类:
其他好文 时间:
2015-02-11 14:10:11
阅读次数:
187
A long-distance telephone company charges its customers by the following rules:Making a long-distance call costs a certain amount per minute, dependin...
分类:
其他好文 时间:
2015-02-11 12:16:42
阅读次数:
172
Description国际象棋的棋盘是黑白相间的8 * 8的方格,棋子放在格子中间。如下图所示:王、后、车、象的走子规则如下:王:横、直、斜都可以走,但每步限走一格。后:横、直、斜都可以走,每步格数不受限制。车:横、竖均可以走,不能斜走,格数不限。象:只能斜走,格数不限。写一个程序,给定起始位置和目...
分类:
其他好文 时间:
2015-02-10 18:37:37
阅读次数:
207
前面学到的内容,搞个小游戏孩子玩的很腻,没意思没意思……看来要加快速度了,直接进入列表和元组:列表(list)是有序的集合,其中的元素可以自由添加和删除:>>>animals=[‘dog‘,‘cat‘,‘pig‘,]
>>>printanimals
[‘dog‘,‘cat‘,‘pig‘]如果要在列表中访问单个动..
分类:
编程语言 时间:
2015-02-09 07:10:25
阅读次数:
189