原创 樹狀數組小結

雖然線段樹可以完美的代替樹狀數組,但是因爲代碼的簡潔性,還是忍不住去學了樹狀數組。。。。 void add(ll *s, ll x,int n,ll v){ for(;x<=n;s[x]+=v,x+=(x&-x)); } ll

原创 Gym - 101020H Weekend

You and your friends are going to camping next weekend , because you are the best driver and you are living in this tow

原创 Mondriaan's Dream ZOJ - 1100

題意:給你一個n*m的矩陣,讓你用1*2(2*1)的小矩陣去填充它,問有多少種方案。 這題,也是看了別人的博客纔有了思路,不過大神們的推導我死活沒看懂,, 我的想法是,設初始狀態爲空(第0行爲滿),末狀態爲滿,一行一行的枚舉所有狀態(所有

原创 HDU - 2586 How far away ? (Lca)

There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like

原创 C - The Battle of Chibi

Cao Cao made up a big army and was going to invade the whole South China. Yu Zhou was worried about it. He thought the

原创 B - Dining (最大流)

Cows are such finicky eaters. Each cow has a preference for certain foods and drinks, and she will consume no others. F