链接: http://vj.acmclub.cn/contest/view.action?cid=168#problem/E 时限:250MS 内存:4096KB 64位IO格式:%I64d & %I64u 提交 状态 练习 SGU 105 问题描述 There is sequence 1, 12, 123, 1234, ..., 12345678910, ... . Given first N elements of that sequence. You must determ…
There is sequence 1, 12, 123, 1234, ..., 12345678910, ... . Given first N elements of that sequence. You must determine amount of numbers in it that are divisible by 3. Input Input contains N (1<=N<=231 - 1). Output Write answer to the output. Sampl…
There is sequence 1, 12, 123, 1234, ..., 12345678910, ... . Given first N elements of that sequence. You must determine amount of numbers in it that are divisible by 3. Input Input contains N (1<=N<=231 - 1). Output Write answer to the output. Sampl…
987654321 problem Problem's Link Mean: 略 analyse: 这道题目是道简单题. 不过的确要好好想一下: 通过简单的搜索可以知道,在N<9时答案一定为0,而N=9时有8个解.由于题目只是问“最后9位”,所以N=10的时侯第10位的取值不会对平方和的“最后9位”产生影响,而第10位上有9种取值方法,所以N=10的时侯,答案是72. 同样可以知道,当N>10的时侯,只要在72后加入(N-10)个“0”即可. Time complexity: O(n) vie…