原创 HDU - 5489 Removed Interval(最長上升子序列)

HDU - 5489 Removed Interval(最長上升子序列) Given a sequence of numbers A=a1,a2,…,aN, a subsequence b1,b2,…,bk of A is ref

原创 最長雙迴文串 HYSBZ - 2565(迴文樹的應用)

最長雙迴文串 HYSBZ - 2565(迴文樹的應用) 順序和逆序讀起來完全一樣的串叫做迴文串。比如 acbca 是迴文串,而 abc 不是( abc 的順序爲 “abc” ,逆序爲 “cba” ,不相同)。 輸入長度爲 n 的串

原创 Palindromes and Super Abilities URAL - 1960 (迴文樹板子)

Palindromes and Super Abilities URAL - 1960 (迴文樹板子) After solving seven problems on Timus Online Judge with a word

原创 2018寧夏網絡賽 B Goldbach (米勒拉賓素數測試)

2018寧夏網絡賽 B Goldbach (米勒拉賓素數測試) 題目鏈接 題目大意: 給你一個偶數n (2<n<=1e18) 讓你把n分解成兩個素數的和。(如果有多個輸出任意一個) 解題思路: 米勒拉賓素數測試板子 這個板子可以在

原创 POJ - 3685 Matrix (二分套二分)

POJ - 3685 Matrix (二分套二分) Given a N × N matrix A, whose element in the i-th row and j-th column Aij is an number th

原创 單調隊列模板

單調隊列 可以用來找i——i+k中這個區間的最大值或者最小值。 實現方式和單調棧類似 用一個雙向隊列來實現 deque q; 對列裏一些點的位置 用一個數組ml[i] 來記錄i - i-k之間的最小值的位置 那應該怎麼維護呢?就

原创 2019牛客暑期多校訓練營(第九場 E ----All men are brothers 並查集+思維)

2019牛客暑期多校訓練營(第九場 E ----All men are brothers 並查集+思維) 鏈接:https://ac.nowcoder.com/acm/contest/889/E?&headNav=acm 來源:

原创 POJ - 1236 - Network of Schools (targan求強聯通分量縮點)

POJ - 1236 - Network of Schools (targan求強聯通分量縮點) A number of schools are connected to a computer network. Agreement

原创 2019牛客暑期多校訓練營(第十場 B——Coffee Chicken (思維題))

2019牛客暑期多校訓練營(第十場 B——Coffee Chicken (思維題)) 鏈接:https://ac.nowcoder.com/acm/contest/890/B 來源:牛客網 Dr. JYY has just cre

原创 2019牛客暑期多校訓練營(第九場——B Quadratic equation 二次剩餘定理)

鏈接:https://ac.nowcoder.com/acm/contest/889/B 來源:牛客網 題目描述 Amy asks Mr. B problem B. Please help Mr. B to solve the

原创 HDU - 6709 Fishing Master(CCPC網絡賽1008) 貪心+思維

HDU - 6709 Fishing Master(CCPC網絡賽1008) 思維 Heard that eom is a fishing MASTER, you want to acknowledge him as your

原创 HDU - 4738 Caocao's Bridges(targan 求橋(割邊) +判重邊)

HDU - 4738 Caocao’s Bridges(targan 求橋 +判重邊) Caocao was defeated by Zhuge Liang and Zhou Yu in the battle of Chibi.

原创 2019牛客暑假多校第十場 D——Han Xin and His Troops(拓展中國剩餘定理)

2019牛客暑假多校第十場 D——Han Xin and His Troops(拓展中國剩餘定理) 鏈接:https://ac.nowcoder.com/acm/contest/890/D 來源:牛客網 Han Xin was a

原创 2019牛客暑期多校訓練營(第九場 --D Knapsack Cryptosystem 折半搜索)

2019牛客暑期多校訓練營(第九場 --D Knapsack Cryptosystem 折半搜索) 鏈接:https://ac.nowcoder.com/acm/contest/889/D 來源:牛客網 Amy asks Mr.

原创 HDU - 4635 Strongly connected(targan 求差一強聯通分量)

HDU - 4635 Strongly connected(targan 差一強聯通分量) Give a simple directed graph with N nodes and M edges. Please tell m