(水题)987654321 problem -- SGU 107】的更多相关文章

链接: http://vj.acmclub.cn/contest/view.action?cid=168#problem/G 时限:250MS     内存:4096KB     64位IO格式:%I64d & %I64u 提交 状态 练习 SGU 107 问题描述 For given number N you must output amount of N-digit numbers, such, that last digits of their square is equal to 987…
题目大意:求n位数的平方的后几位结果是987654321的个数是多少. 分析:刚看到这道题的时候怀疑过有没有这样的数,于是暴力跑了一下,发现还真有,9位的数有8个,如下: i=111111111, i*i=12345678987654321i=119357639, i*i=14246245987654321i=380642361, i*i=144888606987654321i=388888889, i*i=151234567987654321i=611111111, i*i=373456789…
题目链接: http://acm.sgu.ru/problem.php?contest=0&problem=107 题意: 平方后几位为987654321的n位数有多少个 分析: 虽然说是水题,但是我觉得很好体现了做某些数学题的方法,就是找规律 暴力求出一些较小的数,然后其他位数的数就是在求出的数的前面填数就好了. 然后注意位数很多,所以以字符的形式输出0. 代码: #include<cstdio> int main (void) { int n; scanf("%d&quo…
题目地址:http://acm.sgu.ru/problem.php?contest=0&problem=107 /* 题意:n位数的平方的后面几位为987654321的个数 尼玛,我看描述这一句话都看了半天,其实只要先暴力程序测试一边就知道规律 详细解释:http://www.cnblogs.com/Rinyo/archive/2012/12/04/2802089.html */ #include <cstdio> #include <iostream> #include…
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…
538. Emoticons 题目连接: http://acm.sgu.ru/problem.php?contest=0&problem=538 Description A berland national nanochat Bertalk should always stay up-to-date. That's why emoticons highlighting was decided to be introduced. As making emoticons to be highligh…
p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-size: 10.5000pt } h1 { margin-top: 5.0000pt; margin-bottom: 5.0000pt; text-align: center; font-family: 宋体; color: rgb(26,92,200); font-weight: bold; fo…
Problem A: The 3n + 1 problem Time Limit: 1 Sec  Memory Limit: 64 MBSubmit: 14  Solved: 6[Submit][Status][Web Board] Description Consider the following algorithm to generate a sequence of numbers. Start with an integer n. If n is even, divide by 2. I…
Problem A: Jolly Jumpers Time Limit: 1 Sec  Memory Limit: 64 MBSubmit: 10  Solved: 4[Submit][Status][Web Board] Description A sequence of n > 0 integers is called a jolly jumper if the absolute values of the differences between successive elements ta…
题目传送门 /* 水题:看见x是十的倍数就简单了 */ #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <string> #include <cmath> using namespace std; ; const int INF = 0x3f3f3f3f; int main(void) //HDOJ 4716…