Little BishopsA bishop is a piece used in the game of chess which is played on a board of square grids. A bishop can only move diagonally from its cur...
分类:
其他好文 时间:
2014-07-09 23:05:17
阅读次数:
252
题目:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: P...
分类:
其他好文 时间:
2014-07-09 21:38:15
阅读次数:
207
这两天在进行网站搬家,这次网站搬家采用直接打包mysql数据库和网页文件的形式进行迁移,上传好mysql data目录里面的网站数据库至VPS上mysql存放数据库的目录里面,解压就行。我的VPS存放数据库的路径是 /usr/local/mysql/var。上传好网站数据,解压,配置好数据库链接参数...
分类:
数据库 时间:
2014-07-09 00:02:30
阅读次数:
192
题目如下:
Bicoloring
In 1976 the ``Four Color Map Theorem" was proven with the assistance of acomputer. This theorem states that every map can be colored using only fourcolors, in...
分类:
其他好文 时间:
2014-07-06 12:28:07
阅读次数:
241
Elevator
Time Limit: 1000ms Memory limit: 32768K 有疑问?点这里^_^
题目描述
The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers de...
分类:
其他好文 时间:
2014-07-06 10:52:11
阅读次数:
188
;; Fermat's Little Theorem:
;; If N is a prime number and A is any positive integer less
;; than N, then A raised to the N-th power is congruent to A modulo N
;; Two numbers are said to be congruent...
分类:
其他好文 时间:
2014-07-06 09:05:22
阅读次数:
158
题目链接:uva 1415 - Gauss Prime
题目大意:给出一个a,b,表示高斯数a+bi(i=?2 ̄ ̄ ̄√,判断该数是否为高斯素数。
解题思路;
a = 0 时,肯定不是高斯素数a != 0时,判断a2+2b2是否为素数即可。
#include
#include
#include
bool is_prime (int n) {
int m = sqr...
分类:
其他好文 时间:
2014-07-06 08:36:51
阅读次数:
317
本题是求最小生成树。
给出的是坐标节点,然后需要根据这些坐标计算出各个点之间的距离。
除此就是标准的Prime算法了,能使用Prime的基本上都可以使用Kruskal。
这些经典的算法一定要多写,熟练掌握,否则很难灵活运用的。
而且经典的算法之所以为经典,原因之一是没那么容易自己凭空想象出来的,所以要熟练。
#include
#include
#include
#include ...
分类:
其他好文 时间:
2014-07-06 00:22:21
阅读次数:
338
root@%cd/config/(0到3及rescure文件)root@%cd/var/db/config/(4到49的相关文件)SNMP设置:[editsnmp]communitycardinals{authorizationread-only;clients{10.210.14.0/24;}}链路端口端开后,设备会亮红灯,可以通过如下命令除掉红灯:root#setchassisalarmmanagement-ethe..
分类:
其他好文 时间:
2014-07-05 23:18:45
阅读次数:
285
Description: Given two strings, write a method to decide if one is a permutation of the other.We could use the same idea from CTCI 1.1. The only diffe...
分类:
其他好文 时间:
2014-07-05 21:43:01
阅读次数:
231