Number Sequence
Time Limit: 1000MS | Memory Limit: 10000K | |
Total Submissions: 37805 | Accepted: 10926 |
思路:用一个数组记录从1-n的数长度的总和,另一数组迭代记录前缀和,然后二分逐步缩小范围;
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...Sk. Each group Sk consists of a sequence of positive integer numbers ranging from 1 to k, written one after another.
For example, the first 80 digits of the sequence are as follows:
11212312341234512345612345671234567812345678912345678910123456789101112345678910
For example, the first 80 digits of the sequence are as follows:
11212312341234512345612345671234567812345678912345678910123456789101112345678910