原创 POJ 3255 Roadblocks(兩次求最短路進而得到次短路)

題目描述:https://vjudge.net/contest/374535#problem/C Bessie has moved to a small farm and sometimes enjoys returning to

原创 51Nod 1042 數字0-9的數量(前導0的數位dp)

題目鏈接:https://vjudge.net/contest/374535#problem/F 給出一段區間a-b,統計這個區間內0-9出現的次數。 比如 10-19,1出現11次(10,11,12,13,14,15,16,17

原创 LightOJ 1289 LCM from 1 to n(位圖標記替代素數打標的bool,減小內存)

題目鏈接:https://vjudge.net/contest/373416#problem/A Given an integer n, you have to find lcm(1, 2, 3, …, n) lcm means

原创 CodeForces - 1228C Primes and Multiplication(題意轉化+快速冪)

題目鏈接:https://vjudge.net/contest/373416#problem/I Input 10 2 Output 2 Input 20190929 1605 Output 363165664 Inpu

原创 LightOJ - 1028 Trailing Zeroes (I)(分析題意:唯一分解定理的推廣)

題目鏈接:https://vjudge.net/problem/LightOJ-1028 We know what a base of a number is and what the properties are. For ex

原创 CodeForces 687B Remainders Game(反證法轉化題意)

題目鏈接:https://vjudge.net/contest/373416#problem/G Today Pari and Arya are playing a game called Remainders. Pari cho

原创 B. LCM(分析題意,最小公倍數和因子相聯繫)

題目鏈接:https://vjudge.net/contest/373416#problem/F Ivan has number bb. He is sorting through the numbers aa from 1 to

原创 POJ - 2955 Brackets(區間dp)

題目鏈接:https://vjudge.net/contest/372515#problem/E We give the following inductive definition of a “regular brackets”

原创 HDU 3567 Eight II 八數碼(2)(康拓展開判重+枚舉)

題目鏈接:https://vjudge.net/contest/372515#problem/A Eight-puzzle, which is also called “Nine grids”, comes from an old

原创 P3369 【模板】普通平衡樹(替罪羊樹)

題目鏈接:https://www.luogu.com.cn/problem/P3369 題目描述 您需要寫一種數據結構(可參考題目標題),來維護一些數,其中需要提供以下操作: 插入 x 數 刪除 x 數(若有多個相同的數,因只刪除

原创 CodeForces - 1348C Phoenix and Distribution(思維)

題目鏈接:https://vjudge.net/contest/371907#problem/C Input 6 4 2 baba 5 2 baacb 5 3 baacb 5 3 aaaaa 6 4 aaxxzz 7 1 pho

原创 CodeForces - 1348B Phoenix and Beauty(思維+題幹細節)

題目鏈接:https://vjudge.net/contest/371907#problem/B Phoenix loves beautiful arrays. An array is beautiful if all its s

原创 POJ - 1459 Power Network(最大流EK算法)

題目鏈接:https://vjudge.net/contest/369436#problem/C A power network consists of nodes (power stations, consumers and d

原创 POJ 3274——Gold Balanced Lineup(題意轉化+哈希)

題目鏈接:https://vjudge.net/contest/369436#problem/H Farmer John’s N cows (1 ≤ N ≤ 100,000) share many similarities. In

原创 POJ 3295 Tautology(利用棧處理判斷永真式)

題目鏈接:https://vjudge.net/contest/369436#problem/A WFF 'N PROOF is a logic game played with dice. Each die has six fa