### UVALive 7040 / Gym 100548F – Color [容斥+数论]

Link https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=5052 Mean 有N个格子，现有M种颜色，对这些格子涂色，相邻两个格子不能同色。问恰好用上K种颜色的涂色方法有多少种。 Analysis 14年西安...

### HDU 1664 – Different Digits [数论+暴力BFS]

Link http://acm.hdu.edu.cn/showproblem.php?pid=1664 Problem Given a positive integer n, your task is to find a positive integer m, which is a multiple of n, and that m contains the least number of different digits when represented in decimal. For ...

#### HDU 1664 – Different Digits [数论+暴力BFS]

Link http://acm.hdu.edu.cn/showproblem.php?pid=1664 Problem Given a positive integer n, your task is to find a positive integer m, which is a multi...

### CodeForces 589K – Task processing [暴力/数学/优先队列]

Link http://codeforces.com/problemset/problem/589/K Problem Vasya wants to create a computing system to process arbitrary tasks. As a part of the system he needs an algorithm which will choose an order of task execution. He came up with the follow...

#### CodeForces 589K – Task processing [暴力/数学/优先队列]

Link http://codeforces.com/problemset/problem/589/K Problem Vasya wants to create a computing system to process arbitrary tasks. As a part of the s...

### HDU 5446 – Unknown Treasure [Lucas定理+中国剩余定理+快速乘法]

Link http://acm.hdu.edu.cn/showproblem.php?pid=5446 Problem On the way to the next secret treasure hiding place, the mathematician discovered a cave unknown to the map. The mathematician entered the cave because it is there. Somewhere deep in the ...

#### HDU 5446 – Unknown Treasure [Lucas定理+中国剩余定理+快速乘法]

Link http://acm.hdu.edu.cn/showproblem.php?pid=5446 Problem On the way to the next secret treasure hiding place, the mathematician discovered a cav...

### HDU 5724 – Chess [SG函数+状压]

Link http://acm.hdu.edu.cn/showproblem.php?pid=5724 Problem Alice and Bob are playing a special chess game on an n × 20 chessboard. There are several chesses on the chessboard. They can move one chess in one turn. If there are no other chesses on ...

#### HDU 5724 – Chess [SG函数+状压]

Link http://acm.hdu.edu.cn/showproblem.php?pid=5724 Problem Alice and Bob are playing a special chess game on an n × 20 chessboard. There are sever...

### URAL 1605 – Devil’s Sequence [打表规律+高精度小数]

Link 传送门 Problem Robodevil likes to do some mathematics between rehearsals of his orchestra. Today he invented devilish sequence No. 1729: x0 = 0, x1 = 1, xn = (xn − 1 + xn − 2) / 2. For example, x10 = 0.666015625. Robodevil became interested...

#### URAL 1605 – Devil’s Sequence [打表规律+高精度小数]

Link 传送门 Problem Robodevil likes to do some mathematics between rehearsals of his orchestra. Today he invented devilish sequence No. 1729: x0 =...

### CodeForces 651C – Watchmen [规律+容斥]

Link 传送门 Problem Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at point (xi, yi). They need to arran...

#### CodeForces 651C – Watchmen [规律+容斥]

Link 传送门 Problem Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible....

### HDU 1402 – A * B Problem Plus [FFT模板]

Link 传送门 Problem Calculate A * B. Each line will contain two integers A and B. Process to end of file. Note: the length of each integer will not exceed 50000. For each case, output A * B in one line. Maen 计算A*B，A和B每个数最长50000位。 Analys...

#### HDU 1402 – A * B Problem Plus [FFT模板]

Link 传送门 Problem Calculate A * B. Each line will contain two integers A and B. Process to end of file. Note: the length of each integer will not...

### HDU 4135 – Co-prime [素因子+容斥]

Link 传送门 Problem Given a number N, you are asked to count the number of integers between A and B inclusive which are relatively prime to N. Two integers are said to be co-prime or relatively prime if they have no common positive divisors other ...

#### HDU 4135 – Co-prime [素因子+容斥]

Link 传送门 Problem Given a number N, you are asked to count the number of integers between A and B inclusive which are relatively prime to N. Two ...