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…
来源:点击打开链接 非常easy.找规律. 每去掉一个点,点的总数量就减去n+m-1,然后看谁最先减到没有点可减.就能够了. #include <iostream> #include <cstring> using namespace std; int main() { int n,m; cin>>n>>m; int totalpoint=n*m; int count=0; while(totalpoint>0) { totalpoint-=(n+m-…
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…
Problem about GCD Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 470 Accepted Submission(s): 77 Problem Description Given integer m. Find multiplication of all 1<=a<=m such gcd(a, m)=1 (cop…