原创 POJ - 1655 Balancing Act (樹的重心)
Balancing Act Consider a tree T with N (1 <= N <= 20,000) nodes numbered 1...N. Deleting any node from the tree yield
原创 Gym - 101981 Problem M. Mediocre String Problem (擴展KMP + Manacher)
Problem M. Mediocre String Problem 題目鏈接:https://vjudge.net/problem/Gym-101981M 題目大意:給出兩個串S,T,從S中選擇 i~j 的子串,再從T中選擇前綴 1~k
原创 2019網絡賽總結
這麼多場網絡賽下來,發現了很多自己的不足: 首先就是網絡賽中遇到很多題目都是會的算法,但是沒辦法靈活的運用。就像ccpc網絡賽有一道後綴數組+主席樹的題,知道是後綴數組,但是不知道要到底要怎麼做。還有之前學的有些算法,很久沒有用過,現在已
原创 2019icpc上海網絡賽
比賽鏈接:The Preliminary Contest for ICPC Asia Shanghai 2019 L. Digit sum 簽到題 題目大意:給出n,b,求1-n 的b進制的各個位數之和 思路:因爲n就到10^6可以直接預
原创 POJ - 1873 The Fortified Forest (凸包 + 枚舉)
The Fortified Forest Once upon a time, in a faraway land, there lived a king. This king owned a small collection of r
原创 LightOJ - 1203 Guarding Bananas(凸包 求最小夾角 Graham掃描算法 | 捲包裹算法)
Guarding Bananas Once there was a lazy monkey in a forest. But he loved banana too much. One day there was a storm in t
原创 POJ - 3348 Cows (凸包 求多邊形面積 Graham掃描算法)
Cows Your friend to the south is interested in building fences and turning plowshares into swords. In order to help w
原创 POJ - 1265 Area (計算幾何 Pick定理 叉積)
Area Being well known for its highly innovative products, Merck would definitely be a good target for industrial espi
原创 POJ - 1654 Area (計算幾何 叉積 求多邊形面積)
Area You are going to compute the area of a special kind of polygon. One vertex of the polygon is the origin of the o
原创 POJ - 1228 Grandpa's Estate (穩定凸包 )
Grandpa's Estate Being the only living descendant of his grandfather, Kamran the Believer inherited all of the grandp
原创 POJ - 1113 Wall (凸包 Graham掃描算法)
Wall Once upon a time there was a greedy King who ordered his chief Architect to build a wall around the King's castl
原创 POJ - 2007 Scrambled Polygon (凸包 極角排序)
Scrambled Polygon A closed polygon is a figure bounded by a finite number of line segments. The intersections of the
原创 The Preliminary Contest for ICPC Asia Xuzhou 2019 D. Carneginon (KMP)
D. Carneginon 題目鏈接:https://nanti.jisuanke.com/t/41386 題目大意:給一個母串T,接下來給n個串S,如果S的長度與T的長度相等:如果S與T串相同,輸出:jntm!,否則輸出:friend
原创 Gym - 102222G Factories (樹形DP)
Factories Byteland has nn cities numbered from 11 to nn, and n−1n−1 bi-directional roads connecting them. For each pa
原创 HDU - 1438 鑰匙計數之一 (狀壓DP)
鑰匙計數之一 一把鎖匙有N個槽,槽深爲1,2,3,4。每鎖匙至少有3個不同的深度且至少有1對相連的槽其深度之差爲3。求這樣的鎖匙的總數。 Input 本題無輸入 Output 對N>=2且N<=31,輸出滿足要求的鎖匙的總數。 Sam