……但是没仔细看,直接跳过了 这题直接枚举就可以过了 ;}…
Problem Description Let f(x) = anxn +...+ a1x +a0, in which ai (0 <= i <= n) are all known integers. We call f(x) 0 (mod m) congruence equation. If m is a composite, we can factor m into powers of primes and solve every such single equation after wh…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4573 Problem Description Remember our childhood? A few naked children throw stones standing on the same position, the one throws farther win the game. Aha, of course, there are some naughty boys who care…
Problem Description Bob gets tired of playing games, leaves Alice, and travels to Changsha alone. Yuelu Mountain, Orange Island, Window of the World, the Provincial Museum etc...are scenic spots Bob wants to visit. However, his time is very limited,…
这题当时竟然没看啊…… 找规律:求和m+m+m-1+m-1+……前n项 ;}…
这题在比赛的时候不知道怎么做,后来看了别人的解题报告,才知道公式sn=(a+sqrt(b))^n+(a-sqrt(b))^n; 具体推导 #include<iostream> #include<stdio.h> #include<algorithm> #include<iomanip> #include<cmath> #include<string> using namespace std; struct ma { __int64 a…
[题意]给定N个点,每个点有一个停留所需的时间Ci,和停留能够获得的满意度Si,有M条边,每条边代表着两个点走动所需的时间ti,现在问在规定的T时间内从指定的一点S到E能够获得的最大的满意度是多少?要求停留的点的满意度要依次上升,并且每个点可以选择路过和停留. 好题,收获很大-- 收获一:分层图的应用 收获二:越来越觉得Bellman-Ford or SPFA就是一种图上的DP,不仅仅是求最短路,更可以求某类最优问题. 收获三:像这种点有路过和停留两种状态的题目可以试着Floyd预处理,方便地处…
Problem Description One day, a hunter named James went to a mysterious area to find the treasures. James wanted to research the area and brought all treasures that he could. The area can be represented as a N*M rectangle. Any points of the rectangle…
Problem Description A sequence Sn is defined as:Where a, b, n, m are positive integers.┌x┐is the ceil of x. For example, ┌3.14┐=4. You are to calculate Sn. You, a top coder, say: So easy!  Input There are several test cases, each test case in one lin…
Collision Time Limit: 2 Seconds      Memory Limit: 65536 KB      Special Judge There's a round medal fixed on an ideal smooth table, Fancy is trying to throw some coins and make them slip towards the medal to collide. There's also a round range which…