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…
107. 987654321 problem time limit per test: 0.25 sec. memory limit per test: 4096 KB For given number N you must output amount of N-digit numbers, such, that last digits of their square is equal to 987654321. Input Input contains integer number N (1<…
107. 987654321 problem time limit per test: 0.25 sec. memory limit per test: 4096 KB For given number N you must output amount of N-digit numbers, such, that last digits of their square is equal to 987654321. Input Input contains integer number N (1<…
链接: 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…
For given number N you must output amount of N-digit numbers, such, that last digits of their square is equal to 987654321. Input Input contains integer number N (1<=N<=106) Output Write answer to the output. Sample Input 8 Sample Output 0 简单数学,题目说,…
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…
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…
A New Change Problem Problem Description Now given two kinds of coins A and B,which satisfy that GCD(A,B)=1.Here you can assume that there are enough coins for both kinds.Please calculate the maximal value that you cannot pay and the total number tha…
题目描述 让你输出区间内的素数的个数 分析 预处理筛法,在随便搞一下就好了. AC代码 #include <bits/stdc++.h> using namespace std; #define ms(a,b) memset(a,b,sizeof(a)) typedef long long ll; const int maxn=1000005; int sum[maxn],vis[maxn]; inline int read(){ int X=0,w=0; char ch=0; while(!…
1094 - Farthest Nodes in a Tree problem=1094" style="color:rgb(79,107,114)"> problem=1094&language=english&type=pdf" style="color:rgb(79,107,114)">PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Li…
E. Ehab's REAL Number Theory Problem 数论+图论 求最小环 题目大意: 给你一个n大小的数列,数列里的每一个元素满足以下要求: 数据范围是:\(1<=a_i<=10^6\) \(a_i\) 最多只有7个因数 题目要求在这个数列找到一个最短的子数列,子数列的所有的数相乘是一个完全平方数. 题解: 这个题对于 \(x^{3}\) 应该等价于 \(x\) ,其实就是可以除去 \(a_i\)中的所有的平方项,显而易见,这个并不影响答案. 因为 \(a_i\) 最多只…
X problem X问题 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4358 Accepted Submission(s): 1399 Problem Description 求在小于等于N的正整数中有多少个X满足:X mod a[0] = b[0], X mod a[1] = b[1], X mod…
题意: 给出n, k,求 分析: 假设,则k mod (i+1) = k - (i+1)*p = k - i*p - p = k mod i - p 则对于某个区间,i∈[l, r],k/i的整数部分p相同,则其余数成等差数列,公差为-p 然后我想到了做莫比乌斯反演时候有个分块加速,在区间[i, n / (n / i)],n/i的整数部分相同,于是有了这份代码. #include <cstdio> #include <algorithm> using namespace std;…