Codeforces 581C - Developing Skills(贪心)

Description Petya loves computer games. Finally a game that he’s been waiting for so long came out! The main character of this game has n different skills, each of which is characterized by an integer ai from 0 to 100. The higher the number ai is, the higher is the i-th skill of the character. The total rating of the character is calculated as the sum of

HDU 3714 - Error Curves (三分查找)

Description Josephina is a clever girl and addicted to Machine Learning recently. She pays much attention to a method called Linear Discriminant Analysis, which has many interesting properties. In order to test the algorithm’s efficiency, she collects many datasets. What’s more, each data is divided into two parts: training data and test data. She gets

POJ 1905 - Expanding Rods(二分查找)

Description When a thin rod of length L is heated n degrees, it expands to a new length L’=(1+n*C)*L, where C is the coefficient of heat expansion. When a thin rod is mounted on two solid walls and then heated, it expands and takes the shape of a circular segment, the original rod being the chord of the

POJ 3070 - Fibonacci (矩阵快速幂)

Description In the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn − 1 + Fn − 2 for n ≥ 2. For example, the first ten terms of the Fibonacci sequence are: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, … An alternative formula for the Fibonacci sequence is Given an integer n, your goal is to compute the last 4 digits of

POJ 3233 - Matrix Power Series(矩阵快速幂)

Description Given a n × n matrix A and a positive integer k, find the sum S=A+A2+A3+…+Ak. Input The input contains exactly one test case. The first line of input contains three positive integers n (n ≤ 30), k (k ≤ 109) and m (m Output Output the elements of S modulo m in the same