原创 [序列自動機+倍增] 查詢是否存在一個給出的全排列的循環右移是給定區間的子序列 CF1143E

E. Lynyrd Skynyrd time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standar

原创 [DAG支配樹(拓撲排序+LCA)] HDU6604 Blow up the city

Blow up the city Time Limit: 5000/5000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission

原创 [tarjan縮點 + 割點 / 割邊 + 重邊] 無向圖求割點

#include <iostream> #include <cstdio> #include <cmath> #include <stack> #include <cstring> #define ll long long #defi

原创 [單調隊列] 滑動窗口 求長度爲m區間內最小值 洛谷P1440

題目描述 一個含有n項的數列(n<=2000000),求出每一項前的m個數到它這個區間內的最小值。若前面的數不足m項則從第1個數開始,若前面沒有數則輸出0。 輸入輸出格式 輸入格式:   第一行兩個數n,m。 第二行,n個正整數,爲所給定

原创 [2-SAT] 輸出路徑 POJ3683 Priest John's Busiest Day

Priest John's Busiest Day Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 13255   Accepted: 4495   Special

原创 [概率01揹包] D - Just another Robbery LightOJ - 1079

As Harry Potter series is over, Harry has no job. Since he wants to make quick money, (he wants everything quick!) so h

原创 [硬核線段樹] 2018CCPC吉林I.lovers

Lovers Time Limit: 25000/15000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 351

原创 [tarjan + lca] 動態加邊求橋

D - Network  POJ - 3694  A network administrator manages a large network. The network consists of N computers and M lin

原创 [KM算法 O(n^ 3) ] 帶權二分圖最大匹配

奔小康賺大錢 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 18257  

原创 約瑟夫環 n, k 第 m 個出圈

原文鏈接:https://www.cnblogs.com/scaulok/p/9911819.html ACM-ICPC 2018 瀋陽賽區現場賽 K. Let the Flames Begin

原创 [DP + 序列自動機] 修改子串並詢問原串中是否包含子串 CF1150D

D. Three Religions time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standa

原创 [倍增] 將帶權樹分割爲數量最少的鏈 CF1059E

E. Split the Tree time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standar

原创 [tarjan縮點 + 割點] 無向圖求割點 (無法提交未驗證)

#include <iostream> #include <cstdio> #include <cmath> #include <stack> #include <cstring> #define ll long long #defi

原创 [tarjan模板] 需要幾個點覆蓋整張圖+需要增加幾條邊 使全圖強聯通

A - Network of Schools  POJ - 1236  A number of schools are connected to a computer network. Agreements have been devel

原创 [拓撲排序] 橫縱塗色 ZOJ3780

E - Paint the Grid Again  ZOJ - 3780  Leo has a grid with N × N cells. He wants to paint each cell with a specific colo