其实挺水的,因为两个数平方,只有固定的后面几位数会影响到最后结果的后面几位数。也就是说,如果想在平方之后尾数为987654321,那么就有固定的几个尾数在平方后会是这个数,打个表,发现 10^8 内 没有,10^9 内只有 8 个,然后排列组合……

上代码:

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cstring>
using namespace std;
typedef long long LL; int main()
{
int n;
scanf("%d", &n);
if (n <= ) printf("0\n");
else if (n == ) printf("8\n");
else
{
printf("");
for (int i = ; i <= n-; ++i)
printf("");
printf("\n");
}
}

sgu 107 987654321 problem的更多相关文章

  1. 找规律 SGU 107 987654321 problem

    题目地址:http://acm.sgu.ru/problem.php?contest=0&problem=107 /* 题意:n位数的平方的后面几位为987654321的个数 尼玛,我看描述这 ...

  2. 数论 - SGU 107 987654321 problem

    987654321 problem Problem's Link Mean: 略 analyse: 这道题目是道简单题. 不过的确要好好想一下: 通过简单的搜索可以知道,在N<9时答案一定为0, ...

  3. SGU 107 987654321 problem【找规律】

    题目链接: http://acm.sgu.ru/problem.php?contest=0&problem=107 题意: 平方后几位为987654321的n位数有多少个 分析: 虽然说是水题 ...

  4. SGU 107

    107. 987654321 problem time limit per test: 0.25 sec. memory limit per test: 4096 KB For given numbe ...

  5. sgu107. 987654321 problem 简单打表 难度:0

    107. 987654321 problem time limit per test: 0.25 sec. memory limit per test: 4096 KB For given numbe ...

  6. (水题)987654321 problem -- SGU 107

    链接: http://vj.acmclub.cn/contest/view.action?cid=168#problem/G 时限:250MS     内存:4096KB     64位IO格式:%I ...

  7. 987654321 problem - SGU 107(找规律)

    题目大意:求n位数的平方的后几位结果是987654321的个数是多少. 分析:刚看到这道题的时候怀疑过有没有这样的数,于是暴力跑了一下,发现还真有,9位的数有8个,如下: i=111111111, i ...

  8. SGU107——987654321 problem

    For given number N you must output amount of N-digit numbers, such, that last digits of their square ...

  9. SGU 205. Quantization Problem

    205. Quantization Problem time limit per test: 0.25 sec. memory limit per test: 65536 KB input: stan ...

随机推荐

  1. 对PostgreSQL的prepared statement的深入理解

    看官方文档: http://www.postgresql.org/docs/current/static/sql-prepare.html PREPARE creates a prepared sta ...

  2. MYSQL BLOB 字段大小以及个数的限制測试。

    測试结论 mysql版本号 5.1     表类型: innodb, row_format=compact (这是默认的行格式)     插入超过10个blob, blob的数据量非常小(<76 ...

  3. label WordWrap

    procedure TForm1.FormCreate(Sender: TObject);begin    Label1.AutoSize := False;    Label1.WordWrap : ...

  4. [React Fundamentals] Using Refs to Access Components

    When you are using React components you need to be able to access specific references to individual ...

  5. 《SAS编程与数据挖掘商业案例》学习笔记之十七

    继续读书笔记,本次重点sas sql语句,因为sql内容多且复杂,本文仅仅介绍商业应用中经常使用的而且easy出错的地方,内容包含:单表操作.多表关联.子查询以及merge和join的差别 1.单表操 ...

  6. 自学JavaScript笔记

    最近看了一段时间的<JavaScipt高级编程设计>由于记性不是很好,经常性的看了又忘记:想一些文字整理在自己的博客上,方便没事都可以拿出来看一下: 第一章 JavaScript概述   ...

  7. 编程之linux与win区别

    换行符在Linux和Windows下的区别 一.区别 换行符: 1.windows中的换行符是\r\n, 2. linux/unix下的换行符是\n. 其中: 回车符:\r=0x0d (13) ret ...

  8. iOS简单加载一个网页

    .h文件中 @property(strong ,nonitomic) UIWebView * webView; .m文件中 -(void)viewDidLoad { self.webview = [[ ...

  9. xss脚本攻击

    xss脚本攻击不仅仅只是alert(1)就算完了,xss脚本攻击真正的用处是盗取普通用户的cookie,或者盗取管理员的cookie. xss分类(类型): 1. 反射型xss2. 存储型xss3. ...

  10. 获取mp4文件信息

    计算电影长度 方法1 从mvhd - movie header atom中找到time scale和duration,duration除以time scale即是整部电影的长度. time scale ...