原创 【DP|數學+預處理】POJ-1160 Post Office

Post Office Time Limit: 1000MS Memory Limit: 10000K Description There is a straight highway with villages alongs

原创 【DP】POJ-1157 LITTLE SHOP OF FLOWERS

LITTLE SHOP OF FLOWERS Time Limit: 1000MS Memory Limit: 10000K Description You want to arrange the window of you

原创 【DP|多重揹包可行性】POJ-1014 Dividing

Dividing Time Limit: 1000MS Memory Limit: 10000K Description Marsha and Bill own a collection of marbles. They w

原创 【樹狀數組】樹狀數組一維二維模板

以下模板都是點更新,區間查詢,如果是區間更新點查詢,只需將利用lowbit的循環方向倒過來 一維: inline int lowbit(int x) { return x & -x; } void add(int x, int

原创 【數據結構課程作業】單鏈表逆置

以下是上一次的單鏈表就地逆置,我爲了遞歸起來比較方便多申請了一個結點(尾指針),應該說跟老師的比起來,我不是正解,我不知道不能多申請一個哪怕一個結點。 #include <stdio.h> #include <stdlib.h> typ

原创 【連通圖|邊雙連通分量+Tarjan+並查集】POJ-3694 Network(400+ms)

Network Time Limit: 5000MS Memory Limit: 65536K Description A network administrator manages a large network.

原创 【後綴數組|最長迴文子串】URAL-1297 Palindrome

1297.Palindrome Time limit: 1.0 second Memory limit: 64 MB The “U.S. Robots” HQ has just received a rather alarming

原创 【Treap】Treap模板

struct Node { Node *ch[2]; int Rank; int val, sz; int cmp(int x) const { if(x == val) return -1

原创 【連通圖|強連通分量+最長路】POJ-3592 Instantaneous Transference

Instantaneous Transference Time Limit: 5000MS Memory Limit: 65536K Description It was long ago when we played

原创 雜記 Ver 0.0.8

我的ACM模板已經出到第三版了,是不是要申請個版權印幾份賣呢?2333333~ 真是想多了。 關於連通度問題已經處理完畢,藍皮書除了最後一章平面圖着色之外已經刷完了,哦似乎還有兩題被我跳了?一個幾何一個樹形DP吧…… LCA問題學會