原创 POJ 3126 && HDU 1973 Prime Path (素數表 + BFS)

#include <stdio.h> #include <string.h> int ha[10001]; int p[10001]; //0: 質數 1:合數 int ncase; int s,e,tmp; struct queu

原创 = =大家一起黑馬忠啊

曹操挾天子令諸侯,後被躲在一旁吳國的馬忠一箭射死。劉備三顧茅廬,後被躲在一旁吳國的馬忠一箭射死。孫權率軍在赤壁大破曹操,後被躲在一旁吳國的馬忠一箭射死。孫堅參與了討伐董卓,後被躲在一旁吳國的馬忠一箭射死。孫策平定江東諸郡,後被躲在一旁吳國

原创 0-1揹包

關於HDU 2602 ,按照算法課上講的寫了一下 二維: #include <stdio.h> #include <string.h> int n,c; int v[1001]; int w[1001]; int dp[1001][

原创 每日一水~ 2012-4-24 HDU2002 HDU1004

HDU2002:#import <stdio.h> #define PI 3.1415927 double r; int main() {while (~scanf("%lf",&r)) {printf("%.3lf\n",(4.0/3.

原创 POJ 1050 最大連續子矩陣和

其實就是最大連續子段和+枚舉~ 參考: http://www.cnblogs.com/fll/archive/2008/05/17/1201543.html #include <stdio.h> int a[101][101]; in

原创 每日一水~ 2012-04-25 HDU 1021 HDU 1002

HDU 1021: 餓。。打表。。算出每項%3的結果即可 #import <stdio.h> int a[1000001]; int main() { int input; a[0] = 7%3; a[1] = 11%3; fo

原创 【轉】Perl的die、warn、eval函數

在Windows中,不能使用 or die $!. die函數18.4 錯誤處理在很多情況下,系統調用可能會失敗;例如,嘗試打開不存在的文件,或者刪除某個仍含有文件的目錄,或者嘗試讀取沒有讀權限的文件。在前面的示例中,我們已經用到了d

原创 在Mac系統中使用updatedb命令

一般Uix系的系統都有Updatedb命令,用來更新文件系統的索引,在Mac上直接輸入 updatedb的話會報錯,找不到該命令。 Mac其實是有同樣的命令的,不過不是這樣叫,而是locate.updatedb。位置在: /usr

原创 Qt安裝之後出現qmake命令無法找到

原文地址: http://blog.chinaunix.net/uid-26794077-id-3137142.html 如果已經正確的安裝了Qt,那麼不要再抱有qmake沒有安裝上的幻想,它真的已經在你的電腦上了,在哪裏呢,到你的安裝