public class Solution { public ArrayList GetLeastNumbers_Solution(int [] input, int k) { ArrayList ret = new ArrayList(); if(k > input.length) return ... ...
分类:
其他好文 时间:
2019-03-01 11:00:20
阅读次数:
159
https://vjudge.net/contest/70324 A - Beautiful numbers 统计区间内的,被数位上各个为零数字整除的数的个数。 下面是暴力的数位dp写法,绝对会TLE的,因为这个要深入到每个数字的最后才能判断是否合法。因为(错误的状态设计导致完全变成暴力dfs搜索) ...
分类:
其他好文 时间:
2019-02-28 22:50:01
阅读次数:
205
In mathematics, the nth harmonic number is the sum of the reciprocals of the first n natural numbers: In this problem, you are given n, you have to fi ...
分类:
其他好文 时间:
2019-02-28 21:21:21
阅读次数:
179
1120 Friend Numbers (20 分) Two integers are called "friend numbers" if they share the same sum of their digits, and the sum is their "friend ID". For ...
分类:
其他好文 时间:
2019-02-28 01:10:03
阅读次数:
156
1108 Finding Average (20 分) The basic task is simple: given N real numbers, you are supposed to calculate their average. But what makes it complicated ...
分类:
其他好文 时间:
2019-02-27 01:45:34
阅读次数:
177
题面: Alexandra has a paper strip with n numbers on it. Let's call them ai from left to right. Now Alexandra wants to split it into some pieces (possibl ...
分类:
其他好文 时间:
2019-02-26 19:12:03
阅读次数:
267
Given a set of N (>1) positive integers, you are supposed to partition them into two disjoint sets A?1?? and A?2?? of n?1?? and n?2?? numbers, respect ...
分类:
编程语言 时间:
2019-02-26 16:58:05
阅读次数:
269
1067 Sort with Swap(0, i) (25 分) Given any permutation of the numbers {0, 1, 2,..., N?1}, it is easy to sort them in increasing order. But what if Swa ...
分类:
其他好文 时间:
2019-02-26 11:43:16
阅读次数:
185
Write a program that finds and displays all pairs of 5-digit numbers that between them use the digits 0 through 9 once each, such that the first numbe ...
分类:
其他好文 时间:
2019-02-25 23:10:32
阅读次数:
209
大意: 给定集合a, 求a的按位与和等于0的非空子集数. 首先由容斥可以得到 $ans = \sum \limits_{0\le x <2^{20}} (-1)^{\alpha} f_x$, 其中$\alpha$为$x$二进制中$1$的个数, $f_x$表示与和等于$x$的非空子集数. $f_x$是 ...
分类:
其他好文 时间:
2019-02-25 13:43:20
阅读次数:
162