SGU 403 Scientific Problem】的更多相关文章

403. Scientific Problem Time limit per test: 0.25 second(s)Memory limit: 65536 kilobytes input: standardoutput: standard Once upon a time Professor Idioticideasinventor was travelling by train. Watching cheerless landscape outside the window, he deci…
403. Scientific Problem Time limit per test: 0.25 second(s) Memory limit: 65536 kilobytes input: standard output: standard Once upon a time Professor Idioticideasinventor was travelling by train. Watching cheerless landscape outside the window, he de…
题目地址: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…
205. Quantization Problem time limit per test: 0.25 sec. memory limit per test: 65536 KB input: standard output: standard When entering some analog data into a computer, this information must be quantized. Quantization transforms each measured value…
题目链接: http://acm.sgu.ru/problem.php?contest=0&problem=107 题意: 平方后几位为987654321的n位数有多少个 分析: 虽然说是水题,但是我觉得很好体现了做某些数学题的方法,就是找规律 暴力求出一些较小的数,然后其他位数的数就是在求出的数的前面填数就好了. 然后注意位数很多,所以以字符的形式输出0. 代码: #include<cstdio> int main (void) { int n; scanf("%d&quo…
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…
其实挺水的,因为两个数平方,只有固定的后面几位数会影响到最后结果的后面几位数.也就是说,如果想在平方之后尾数为987654321,那么就有固定的几个尾数在平方后会是这个数,打个表,发现 10^8 内 没有,10^9 内只有 8 个,然后排列组合…… 上代码: #include <cstdio> #include <cstring> #include <cstdlib> #include <cstring> using namespace std; typed…
408. Game with points Time limit per test: 0.25 second(s)Memory limit: 65536 kilobytes input: standardoutput: standard Recently Petya has discovered new game with points. Rules of the game are quite simple. First, there is only one point A0 with coor…
SGU 105-DIV 3 Problem's Link Mean: 定义这样一种数列:1,12,123.. 给出一个n,求这个数列中能被3整除的数的个数. analyse: 这道题可以用分析的方法解决: 对于正整数k,k+1,k+2总有 k+(k+1)+(k+2) =k+k+1+k+2 =3k+3 =3(k+1) 3(k+1)可以被3整除,而且,一个数是否能被3整除表现为它的各位数字之和能否被三整除. 这就意味着对于一个数12345678910111213...k(连写),我们可以从后面开始,…
SGU 100 A+B :太神不会 SGU 101 Domino: 题目大意:有N张骨牌,两张骨牌有两面有0到6的数字,能相连当且仅当前后数字相同,问能否有将N张骨牌连接的方案?思路:裸的欧拉回路,注意自环,连通 //sgu101 #include<iostream> #include<cstdio> #include <math.h> #include<algorithm> #include<string.h> #include<queu…