问题描述: A self-dividing number is a number that is divisible by every digit it contains. For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0. Also, a
题意:在长为L的草地上装喷水头,喷射是以这个喷水头为中心,喷水头的喷洒半径是可调节的,调节范围为[a,b]。要求草地的每个 点被且只被一个喷水头覆盖,并且有些连续区间必须被某一个喷水头覆盖,而不能由多个喷头分段完全覆盖,求喷水头的最小数目。 思路:设dp[i]表示正好喷到i这个位置缩安放的最少喷泉数,那么dp[i]=min(dp[k])+1 (i - 2 * B <= k <= i -
Dividing Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 8 Accepted Submission(s) : 3 Font: Times New Roman | Verdana | Georgia Font Size:
Dividing the Path点击转到 Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 5588 Accepted: 1968 Description Farmer John's cows have discovered that the clover growing along the ridge of the hil
Problem Description RXD has a tree T , with the size of n . Each edge has a cost. Define f(S) as the the cost of the minimal Steiner Tree of the set S on tree T . he wants to
题目链接 You are given two integers a and b. In one turn, you can do one of the following operations: Take an integer c (c>1 and a should be divisible by c) and replace a with ac; Take an integer c (c>1
http://poj.org/problem?id=1014 #include<iostream> #include<string> #define max(x,y) x>y?x:y using namespace std; int dp[150000],w[20010],v[20010]; int main() { int a[10],i,j,t=1,c,num; while(