原创 HDU 6224 (ICPC 瀋陽 2017 H) Legends of the Three Kingdoms(記憶化搜索)

Legends of the Three Kingdoms Time Limit: 8000/4000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Tot

原创 Puzzle Game HihoCoder - 1634(ICPC 北京 2017 H )最大子矩陣+思維

傳送門:https://hihocoder.com/problemset/problem/1634 題意:給你一個n*m(n,m<=150)的數字矩陣,每個元素val(-1000<=val<=1000),以及一個數字p(-1000<=p<

原创 Codeforces Round #647 (Div. 2) - Thanks, Algo Muse! F. Johnny and Megan’s Necklace(思維+歐拉回路)

F. Johnny and Megan's Necklace time limit per test 3 seconds memory limit per test 512 megabytes input standard input o

原创 Pangu and Stones HihoCoder - 1636 (ICPC 2017 北京 J) 區間dp

傳送門:https://hihocoder.com/problemset/problem/1636 題意: 給你n(<=100)堆石子的數量,再給你兩個數L,R(2<=L<=R<=n),表示你只能將連續的x(L<=x<=R)堆石子合併成爲

原创 2014-2015 ACM-ICPC, Asia Xian Regional Contest Problem C. The Problem Needs 3D Arrays(網絡流之最大密度子圖)

題意: 給你一個長度爲n(<=100)的序列T,S爲T的任意子序列,r(S)表示子序列S(不連續)中的逆序對數,l(S) 表示S的長度,求出 r(S) / l(S) 的最大值。 思路: 將r(S)看成邊,l(S)看成點,問題轉化爲求 E

原创 2014-2015 ACM-ICPC, Asia Xian Regional Contest Problem H. The Problem to Make You Happy(博弈,記憶化搜索)

題意: 給你n(<=100)個點m(<=n*(n-1))條邊的有向簡單圖,Alice和Bob(兩個人都足夠聰明)在這個圖上玩遊戲,兩個人輪流沿着有向圖走,一次只能走一條邊,Bob先走,如果Alice和Bob走到同一個點,或者Bob無法走了

原创 ZOJ 3954 Seven-Segment Display(思維)

Seven-Segment Display Time Limit: 1 Second      Memory Limit: 65536 KB A seven segment display, or seven segment indica

原创 Educational Codeforces Round 88 (Rated for Div. 2) E. Modular Stability(組合數模板)

E. Modular Stability time limit per test 2 seconds memory limit per test 512 megabytes input standard input output stan

原创 Codeforces Round #638 (Div. 2) F. Phoenix and Memory(貪心+線段樹)

F. Phoenix and Memory time limit per test 2 seconds memory limit per test 256 megabytes input standard input output sta

原创 牛客練習賽63 F 牛牛的樹行棋 (SG函數+樹差分)

鏈接:https://ac.nowcoder.com/acm/contest/5531/F 來源:牛客網   牛牛的樹行棋 時間限制:C/C++ 2秒,其他語言4秒 空間限制:C/C++ 524288K,其他語言1048576K 64bi

原创 C++ bitset用法小結

原文:https://blog.csdn.net/weixin_44529350/article/details/102983704 C++的 bitset 在 bitset 頭文件中,它是一種類似數組的結構,它的每一個元素只能是0或1,

原创 2020年4月26日訓練日記

01bfs可以O(V+E)求解邊權全爲1的圖上最短路。 而當邊權只有0或1時,使用其它最短路算法是有些浪費的,此時可以使用bfs的變種:0-1 bfs來快速求解,複雜度仍爲O(V+E). 01bfs維護一個雙端隊列,當邊權爲0時,使用pu

原创 Codeforces Round #637 (Div. 2) - Thanks, Ivan Belonogov! D. Nastya and Scoreboard(貪心+dp)

D. Nastya and Scoreboard time limit per test 1 second memory limit per test 256 megabytes input standard input output s

原创 Codeforces Round #635 (Div. 2) C - Linova and Kingdom(樹形dp+思維)

Linova and Kingdom time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa

原创 Educational Codeforces Round 85 (Rated for Div. 2)E. Divisor Paths(數論,思維)

E. Divisor Paths time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard