原创 POJ2371

摘要:排序,水。 #include <iostream> #include <stdio.h> #include <algorithm> using namespace std; const int size = 100000; int

原创 POJ2418

 摘要:水,排序   #include <iostream> #include <stdio.h> #include <string> #include <iomanip> #include <algorithm> using names

原创 POJ2388

 摘要:數據太弱,排序就過了。可以做到o(n) #include <iostream> #include <algorithm> using namespace std; const int size = 10000; int input

原创 POJ1979

摘要:BFS   #include <iostream> #include <stdio.h> #include <queue> using namespace std; const int size = 20; int input[si

原创 POJ1028

 摘要:瀏覽器前進後退的實現,stack的操作   #include <iostream> #include <string> using namespace std; const int size = 100; string forwa

原创 POJ2362

摘要:DFS, 和1151查不多,注意剪枝。   #include <iostream> #include <algorithm> #include <iterator> using namespace std; const int si

原创 POJ2301

 摘要:快被淹死了。。。   #include<iostream> using namespace std; int main() {         int cyle,a,b;         cin>>cyle;         w

原创 POJ1753

 摘要:BFS, 狀態壓縮的搜索,位操作。     #include <iostream> #include <queue> #include <cassert> using namespace std; const int MAX_ST

原创 POJ2245

 摘要:枚舉,暴搜^_^   #include <iostream> using namespace std; const int SIZE = 12; int input[SIZE] = {0}; int k;     int mai

原创 POJ2159

摘要:讀懂題意是關鍵,只要兩個字符串每個頻次的字母的個數相同就可以了。   #include <iostream> #include <algorithm> using namespace std; const int size = 10

原创 POJ1012

 摘要:枚舉的時候考慮剩下最後個 bad guy的時候,把圈打開排成隊,bad guy作爲最後一個。這時候要麼是從bad guy開始或從第一個開始, 從bad guy開始:m=t(k+1)+1 (t=1, 2, 3....) 從第一個開始

原创 POJ1423

摘要:靠公式過的。都打表會超時,有牛人只對奇數打表過的。   #include <iostream> #include <stdio.h> #include <cmath> using namespace std; const int P

原创 POJ1068

 摘要:普通模擬題 #include <iostream> #include <string.h> using namespace std; const int size = 100; int s[size+1]= {0}; int f[

原创 開始寫博客

如題。今後把每天做過的題目貼上來。天天給自己一個提醒。 20091017   升到2級 20091024   升到3級 20091029   驚喜的發現終於在POJ水了50題了。哈哈 20091115   升到4級 20091116  

原创 POJ1411

打表求出100000以內的所有素數,再枚舉就是了   #include <iostream> #include <cmath> #include <set> using namespace std; bool checkPrime(int