数位DP... Balanced Number Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 1337 Accepted Submission(s): 583 Problem Description A balanced number is a non-negative integer that can be balanced…
Big Number Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5930 Accepted Submission(s): 4146 Problem Description As we know, Big Number is always troublesome. But it's really important in our…
Problem Description In many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are given a number, you have to determine the number of…
Problem Description Welcome to 2006'4 computer college programming contest! Specially, I give my best regards to all freshmen! You are the future of HDU ACM! And now, I must tell you that ACM problems are always not so easy, but, except this one- Ha-…
当进制转换后所剩下的为数较少时(2位.3位),相应的base都比較大.能够用数学的方法计算出来. 预处理掉转换后位数为3位后,base就小于n的3次方了,能够暴力计算. . .. Lucky Number Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 521 Accepted Submission(s): 150 Probl…
静态区间第K小....划分树裸题 Kth number Time Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5341 Accepted Submission(s): 1733 Problem Description Give you a sequence and ask you the kth big number of a int…
B-number Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1561 Accepted Submission(s): 854 Problem Description A wqb-number, or B-number for short, is a non-negative integer whose decimal form…
dp [ x ] [ y ] [ z ] 表示二进制y所表示的组合对应的之和mod x余数为z的最小数... 如可用的数字为 1 2 3 4...那么 dp [ 7 ] [ 15 ] [ 2 ] = 1234 .... 输入一个数列后..将dp的表做出来..然后O(1)的输出...题目要求是( T + X ) % K =0 可以转化为 T % K = ( K - ( X % K ) ) % K Program: #include<iostream> #include<stdio.h>…
Number Sequence Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 8600 Accepted Submission(s): 3953 Problem Description Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[…
Number Sequence Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9058 Accepted Submission(s): 4149 Problem Description Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[…
The kth great number Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 8246 Accepted Submission(s): 3261 Problem Description Xiao Ming and Xiao Bao are playing a simple Numbers game. In a round…
Number Sequence Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 15017 Accepted Submission(s): 6585 Problem Description Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b…
Problem Description Happy new year to everybody! Now, I want you to guess a minimum number x betwwn 1000 and 9999 to let (1) x % a = 0; (2) (x+1) % b = 0; (3) (x+2) % c = 0; and a, b, c are integers between 1 and 100. Given a,b,c, tell me what is the…
Problem Description Starting from point (0,0) on a plane, we have written all non-negative integers 0, 1, 2,- as shown in the figure. For example, 1, 2, and 3 has been written at points (1,1), (2,0), and (3, 1) respectively and this pattern has conti…
这道题,咋一看很像Fibonacci数列,使用递归或者改进的动态规划来解决.但是仔细一看,(1 <= n <= 100,000,000),使用这些方法,要么超时,要么肯定内存不够用,因此必须想别的办法.遇到这种情况也就只有找规律了.仔细看:f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7,因为存在取模运算,那么当n取到一定值后,f(n)肯定会重复出现.关于找规律的过程,博客园有一位朋友已经进行了详细分析了,请点击链接.下面给出最终的代码: #include&…