原创 UVA-11582 Colossal Fibonacci Numbers!(斐波那契循環節)
The i’th Fibonacci number f(i) is recursively defined in the following way: • f(0) = 0 and f(1) = 1 • f(i +
原创 HDU-1212 Big Number(同餘定理)
As we know, Big Number is always troublesome. But it's really important in our ACM. And today, your task is to write a
原创 HDU-1260 Tickets(簡單DP)
Jesus, what a great movie! Thousands of people are rushing to the cinema. However, this is really a tuff time for Joe w
原创 UVA-294 Divisors(線性篩+唯一分解定理)
Mathematicians love all sorts of odd properties of numbers. For instance, they consider 945 to be an interesting number
原创 UVA-10325 The Lottery(二進制狀態枚舉)
The Sports Association of Bangladesh is in great problem with their latest lottery ‘Jodi laiga Jai’. There are so many
原创 UVA-11827 Maximum GCD(輾轉相除法求GCD)
Given the N integers, you have to find the maximum GCD (greatest common divisor) of every possible pair of these intege
原创 HDU-2391 Filthy Rich(簡單DP)
They say that in Phrygia, the streets are paved with gold. You’re currently on vacation in Phrygia, and to your astonis
原创 HDU-1213 How Many Tables(並查集基礎)
Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables
原创 HDU-1272 小希的迷宮(並查集)
上次Gardon的迷宮城堡小希玩了很久(見Problem B),現在她也想設計一個迷宮讓Gardon來走。但是她設計迷宮的思路不一樣,首先她認爲所有的通道都應該是雙向連通的,就是說如果有一個通道連通了房間A和B,那麼既可以通過它從房間A走
原创 HDU-1213 How Many Tables
Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables
原创 UVA-10325 The Lottery
The Sports Association of Bangladesh is in great problem with their latest lottery ‘Jodi laiga Jai’. There are so many
原创 UVA-294 Divisors
Mathematicians love all sorts of odd properties of numbers. For instance, they consider 945 to be an interesting number
原创 HDU-2391 Filthy Rich
They say that in Phrygia, the streets are paved with gold. You’re currently on vacation in Phrygia, and to your astonis
原创 HDU-4709 Herding
Little John is herding his father's cattles. As a lazy boy, he cannot tolerate chasing the cattles all the time to avoi
原创 UVA-11582 Colossal Fibonacci Numbers!
The i’th Fibonacci number f(i) is recursively defined in the following way: • f(0) = 0 and f(1) = 1 • f(i +