[链接] 我是链接,点我呀:) [题意] 让你从一个集合中找出来一个子集 使得这个子集中任意两个数相减的绝对值是2^的整数次幂 且集合的大小最大 [题解] 考虑子集的个数为4个或4个以上 那么我们找到最小的4个a[1],a[2],a[3],a[4] 显然 dis(1,2)=2^a dis(2,3)=2^b dis(1,3)=dis(1,2)+dis(2,3) = 2^c 因为2^a+2^b=2^c 所以可以推出来a=b 也即dis(1,2)=dis(2,3) 同理对于a[2],a[3],a[4]…
[codeforces 415D]Mashmokh and ACM 题意:美丽数列定义:对于数列中的每一个i都满足:arr[i+1]%arr[i]==0 输入n,k(1<=n,k<=2000),问满足[数列长度是k && 数列中每一个元素arr[i]在1~n之间 && 数列中元素可以重复]的数列有多少个?结果对10^9+7取余 解题思路:dp[i][j]表示长度是j,最后一位是i的种数 if(kk%i==0) dp[kk][j+1]+=dp[i][j] #inc…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Wilbur is playing with a set of n points on the coordinate plane. All points have non-negative integer coordinates. Moreover, if some point (x,…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output When Xellos was doing a practice course in university, he once had to measure the intensity of an effect that slowly approached equilibrium. A g…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Kevin has just recevied his disappointing results on the USA Identification of Cows Olympiad (USAICO) in the form of a binary string of length n…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Kevin Sun has just finished competing in Codeforces Round #334! The round was 120 minutes long and featured five problems with maximum point valu…
time limit per test4 seconds memory limit per test512 megabytes inputstandard input outputstandard output Vanya got bored and he painted n distinct points on the plane. After that he connected all the points pairwise and saw that as a result many tri…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output There is a polyline going through points (0, 0) – (x, x) – (2x, 0) – (3x, x) – (4x, 0) – - - (2kx, 0) – (2kx + x, x) – -. We know that the polyli…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Running with barriers on the circle track is very popular in the country where Dasha lives, so no wonder that on her way to classes she saw the…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output The tram in Berland goes along a straight line from the point 0 to the point s and back, passing 1 meter per t1 seconds in both directions. It me…