uva 10706 Number Sequence(数学规律)】的更多相关文章

题目连接:10706 - Number Sequence 题目大意:有一个有0 ~ 9组成的序列,1   1 2    1 2 3   1 2 3 4   1 2 3 4 5 ....就是第一位为1. 第二为为1 ,第三为为2, 然后10 的部分注意下, 为1  和0 两个, 100 就是1 , 0和0 三位,以此类推, 要求给出tmp, 输出序列中的tmp位为什么数字. 解题思路:数据很大,肯定不能模拟,找规律. 这两个是为推出来的用来打表的公式: 1.sum[i] = sum[i - 1]…
Problem B Number Sequence Input: standard input Output: standard output Time Limit: 1 second A single positive integer i is given. Write a program to find the digit located in the position i in the sequence of number groups S1S2…Sk. Each group Sk con…
题目大意:Sk表示从1到k的字符序列,如S4为1234,现如今有如下的序列S1S2...Sk,形如1 12 123 1234这样的序列,给一个数n,让你去这个序列第n个位置上的数字. 可以构建出一个Sk序列的表格,然后用一个数组sum[i]记录该序列到i是有几位,这样就可以计算出n位于那个Sx序列中,求得在该序列中的位置,再查表即可. #include <cstdio> #include <cmath> #include <cctype> #include <cl…
本文同步发布在CSDN:https://blog.csdn.net/weixin_44385565/article/details/90486252 1104 Sum of Number Segments (20 分)   Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence { 0.1, 0.2, 0.…
Problem Description A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7. Given A, B, and n, you are to calculate the value of f(n).   Input The input consists of multiple test cases. Each test case…
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1005 Number Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 198316    Accepted Submission(s): 49744 Problem Description A number sequence…
解题心得: 1.对于数据很大,很可怕,不可能用常规手段算出最后的值在进行mod的时候,可以思考找规律. 2.找规律时不必用手算(我傻,用手算了好久).直接先找前100项进行mod打一个表出来,直接看就行了. 3.对于像斐波那契数列(本题)的那样,凭借肉眼无法找到规律的时候,可以观察本题的特点.那就是,第一项和第二项不会变,都为1,1.所以循环的时候必定是以1.1为开始,中间的数可以直接记录,很玄幻. 4.还是边界问题,这很重要,这时候数列尽量从1开始,因为在询问的时候都是询问的第n个数,要时刻保…
Number Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 187893    Accepted Submission(s): 46820 Problem Description A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A…
                  Yet another Number Sequence Let’s define another number sequence, given by the following function:f(0) = af(1) = bf(n) = f(n − 1) + f(n − 2), n > 1When a = 0 and b = 1, this sequence gives the Fibonacci Sequence. Changing the values…
Number Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 176080    Accepted Submission(s): 43527 Problem Description A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (…
C. Plus and Square Root time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) an…
找规律,先找属于第几个循环,再找属于第几个数的第几位...... Number Sequence Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 31552 Accepted: 8963 Description A single positive integer i is given. Write a program to find the digit located in the position i in the sequ…
Number Sequence   A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7. Given A, B, and n, you are to calculate the value of f(n).   Input The input consists of multiple test cases. Each test case co…
Number Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 89984    Accepted Submission(s): 21437 Problem Description A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A…
Number Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 152357    Accepted Submission(s): 37087 Problem Description A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A…
Number Sequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 86102 Accepted Submission(s): 20423 Problem Description A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A * f(n…
Number Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 147964    Accepted Submission(s): 35964 Problem Description A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A…
Description A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7. Given A, B, and n, you are to calculate the value of f(n).   Input The input consists of multiple test cases. Each test case contains…
Number Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 175657    Accepted Submission(s): 43409 Problem Description A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A…
HDU 1005 Number Sequence(数论) Problem Description: A number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7. Given A, B, and n, you are to calculate the value of f(n).   Input The input consists of multipl…
Problem Description A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7. Given A, B, and n, you are to calculate the value of f(n). Input The input consists of multiple test cases. Each test case co…
题目地址:http://poj.org/problem?id=1019 Number Sequence Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 35680   Accepted: 10287 Description A single positive integer i is given. Write a program to find the digit located in the position i in…
Description There is a special number sequence which has n+1 integers. For each number in sequence, we have two rules: ● a i ∈ [0,n] ● a i ≠ a j( i ≠ j ) For sequence a and sequence b, the integrating degree t is defined as follows(“�” denotes exclus…
#1584 : Bounce 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 For Argo, it is very interesting watching a circle bouncing in a rectangle. As shown in the figure below, the rectangle is divided into N×M grids, and the circle fits exactly one grid. The bouncing…
 /*Number Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 127146    Accepted Submission(s): 30901 Problem Description A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n…
Number Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 137047    Accepted Submission(s): 33211 Problem Description A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (…
Number Sequence Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 36013   Accepted: 10409 Description A single positive integer i is given. Write a program to find the digit located in the position i in the sequence of number groups S1S2..…
HDU - 1005 Number Sequence Problem Description A number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to calculate the value of f(n). Input The input consists of multiple test…
Number Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 154923    Accepted Submission(s): 37854 Problem Description A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A…
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[…