原创 Uva12230Crossing Rivers (數學期望)

Uva12230Crossing Rivers (數學期望) 問題: You live in a village but work in another village. You decided to follow the strai

原创 ACM-ICPC 2018 焦作網絡預賽 B - Mathematical Curse(dp)

ACM-ICPC 2018 焦作網絡預賽 B - Mathematical Curse A prince of the Science Continent was imprisoned in a castle because of h

原创 ACM-ICPC 2018 焦作網絡預賽K-Transport Ship(多重揹包)

ACM-ICPC 2018 焦作網絡預賽K-Transport Ship There are NNN different kinds of transport ships on the port. The ithi^{th}ith k

原创 Computer HDU - 2196(樹形DP)

Computer HDU - 2196 A school bought the first computer some time ago(so this computer’s id is 1). During the recent y

原创 Zuma HDU - 6212(區間dp)

Zuma HDU - 6212 Think about the Zuma Game. You have a row of at most 200 black(0) or white(1) balls on the table

原创 Brute Force Sorting HDU - 6215(模擬雙向鏈表)

Brute Force Sorting HDU - 6215 Beerus needs to sort an array of N integers. Algorithms are not Beerus’s strength. Des

原创 Puzzled Elena HDU - 5468(dfs序+容斥定理)

Puzzled Elena HDU - 5468 Since both Stefan and Damon fell in love with Elena, and it was really difficult for her to

原创 Apple HDU - 6206(JAVA高精度求三角形外心)

Apple HDU - 6206 Apple is Taotao’s favourite fruit. In his backyard, there are three apple trees with coordinates (x1

原创 Stern-Brocot Tree HDU - 4556(法裏數列長度)

Stern-Brocot Tree HDU - 4556  上圖是一棵Stern-Brocot樹,其生成規則如下:   從第1行到第n行,每行相鄰兩數a/b和c/d,產生中間數(a+c)/(b+d),置於下一行中。將一行的分數(包括

原创 2018ACM-ICPC徐州賽區網絡賽: A. Hard to prepare(遞推)

2018ACM-ICPC徐州賽區網絡賽: A. Hard to prepare(遞推) After Incident, a feast is usually held in Hakurei Shrine. This time Reim

原创 ACM-ICPC 2018 瀋陽賽區網絡預賽 G.Spare Tire (容斥)

Spare Tire A sequence of integer {an}\lbrace a_n \rbrace{an​} can be expressed as: an={0,n=02,n=13an−1−an−22+n+1,n>1\

原创 Reading comprehension HDU - 4990(打表找遞推式+矩陣快速冪)

Reading comprehension HDU - 4990 Read the program below carefully then answer the question. #pragma comment(linker,

原创 Jzzhu and Sequences CodeForces - 450B(矩陣快速冪)

Jzzhu and Sequences CodeForces - 450B Jzzhu has invented a kind of sequences, they meet the following property:

原创 Ryuji doesn't want to study (樹狀數組)

Ryuji doesn’t want to study (樹狀數組) Ryuji is not a good student, and he doesn’t want to study. But there are n books h

原创 Frequent values UVA - 11235(RMQ)

Frequent values UVA - 11235 題意: 給出一個非降序排列的數組,a1,a2,...,ana1,a2,...,an ,對於一系列詢問[l,r][l,r] 回答ai,ai+1,...,ajai,ai+1,...,