原创 UVA - 10474
第五章的第一個大理石的題,附上書上的代碼#include<cstdio> #include<algorithm> using namespace std; const int maxn=10000; int main() { in
原创 CCF 送貨(滿分代碼)2015-12-4
這個代碼的初始版本不是我寫的,借鑑於https://paste.ubuntu.com/p/HTGdYC9Dbv/ 這個題網上的代碼基本上都是七八十分 代碼如下,我加了詳細的註釋 //歐拉路徑的判定 這個網址寫的很詳細 https:
原创 POJ - 3984
定義一個二維數組: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, };
原创 POJ1321(深搜)
在一個給定形狀的棋盤(形狀可能是不規則的)上面擺放棋子,棋子沒有區別。要求擺放時任意的兩個棋子不能放在棋盤中的同一行或者同一列,請編程求解對於給定形
原创 1368 DNA Consensus String
下面是代碼 #include<stdio.h> #include<string.h> main() { char qian[55][1010]; int i,n,a,b,biaoji[4],max,j,sum,p;
原创 CodeForces - 4C
A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to
原创 小希的迷宮(請永遠相信c語言的強大)
c語言,這個被學長逐漸用c++替代的語言,這個每個編程新手都會去接觸的語言,纔是給編程者最大自由的語言,這一點,我深信不疑。 上次Gardon的迷宮城堡小希玩了很久(見Problem B),現在她也想設計一個迷宮讓Gardon來走。但是她
原创 HDU-1754 線段樹的節點更新,儲存區間的最大值
很多學校流行一種比較的習慣。老師們很喜歡詢問,從某某到某某當中,分數最高的是多少。 這讓很多學生很反感。 不管你喜不喜歡,現在需要你做的是,就是按照老師的要求,寫一個程序,模擬老師的詢問。當然,老師有時候需要更新某位同學的成績。 I
原创 感覺自己做這個題的思路很不錯 1225 Digit Counting
這是代碼 #include<stdio.h> #include<string.h> main() { int m,i,l,qian2[10],x,y; scanf("%d",&m); while(m--)
原创 HDU 1072
Description Ignatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrin
原创 感悟
#include<iostream> #include<list> using namespace std; int main() { list<int> a;//設置一個隊列a for(int i=1;i<=5;i++)
原创 227 Puzzle
這個題是給出一個5*5的方格 裏面有一個空格,要求輸入各種字符來代表空格的移動並輸出移動後的5*5圖形, ***這個題給我的收穫是如何跳出一個多重循環,比如for(x=0;x<5;x++)for(y=0;y<5;y++)當在25個數據中
原创 UVa 122 (紫書)
#include<iostream> #include<cstring> #include<vector> #include<queue> #include<cstdio> using namespace std; const int m
原创 UVa 540
題目:Queues and Priority Queues are data structures which are known to most computer scientists. The Team Queue, however
原创 455 periodic strings
這個題是求在一個沒有空格的字符串中,最短的重複的語句的長度是多少 這個題也許用其他方法也能做出來,但我感覺做這個題所運用的思路非常好 #include<stdio.h> #include<string.h> main() { i