原创 Pythagoras HDU - 6211(法裏數列構造+本原勾股數組+本地預處理不出來。。)

Pythagoras HDU - 6211 Given a list of integers a0,a1,a2,⋯,a2k−1. Pythagoras triples over 109 are all solutions of x

原创 233 Matrix HDU - 5015(矩陣快速冪)

233 Matrix HDU - 5015 In our daily life we often use 233 to express our feelings. Actually, we may say 2333, 23333

原创 The Intersection HDU - 6209(二分分數+法裏數列構造)

The Intersection HDU - 6209 A given coefficient K leads an intersection of two curves f(x) and gK(x). In the first

原创 L2-028 秀恩愛分得快 (25 point(s))

古人云:秀恩愛,分得快。 互聯網上每天都有大量人發佈大量照片,我們通過分析這些照片,可以分析人與人之間的親密度。如果一張照片上出現了 K 個人,這些人兩兩間的親密度就被定義爲 1/K。任意兩個人如果同時出現在若干張照片裏,他們之間的親

原创 Monthly Expense(二分)

Monthly Expense Farmer John is an astounding accounting wizard and has realized he might run out of money to run the

原创 Counting UVA - 10198(線性遞推式)

Counting UVA - 10198 題意: Gustavo數數時總是把1和4搞混,他認爲4只是1的另外一種寫法。給出一個整數n,Gustavo想知道有多少個數的數字之和恰好爲n。例如,當n=2時,有5個數:11、14、41、44

原创 Expressions UVA - 10157(組合數學+遞推)

Expressions UVA - 10157 題目: 給你n個括號,求合法的匹配中,深度不超過d的組合數。 分析: 組合,計數,dp,大整數。 這個題目很像卡特蘭數,不過深度有限制,可以利用卡特蘭數的遞推公式求解; 設DP(k,d)

原创 Sum HDU - 4407(容斥定理)

Sum HDU - 4407 XXX is puzzled with the question below: 1, 2, 3, …, n (1<=n<=400000) are placed in a line. There are m

原创 Balloon Robot ZOJ - 3981(思維)

Balloon Robot ZOJ - 3981 The 2017 China Collegiate Programming Contest Qinhuangdao Site is coming! There will be team

原创 Instability HDU - 5917(Ramsey定理)

Instability HDU - 5917 Long long ago, there was a prosperous kingdom which consisted of n cities and every two cites

原创 A Simple Stone Game HDU - 6237(分解質因子+思維)

A Simple Stone Game HDU - 6237 After he has learned how to play Nim game, Bob begins to try another stone game which

原创 K-th Number HDU - 6231(二分+尺取)

K-th Number HDU - 6231 Alice are given an array A[1…N] with N numbers. Now Alice want to build an array B by a parame

原创 Safest Buildings ZOJ - 3993(計算幾何+思維)

Safest Buildings ZOJ - 3993 PUBG is a multiplayer online battle royale video game. In the game, up to one hundred pla

原创 Numbers ZOJ - 3987(二進制思維+貪心)

Numbers ZOJ - 3987 DreamGrid has a nonnegative integer . He would like to divide into nonnegative integers and minimi

原创 Crusaders Quest ZOJ - 3983(思維+暴力)

Crusaders Quest ZOJ - 3983 Crusaders Quest is an interesting mobile game. A mysterious witch has brought great darkne