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…
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…
111.Very simple problem time limit per test: 0.5 sec. memory limit per test: 4096 KB You are given natural number X. Find such maximum integer number that it square is not greater than X. Input Input file contains number X (1≤X≤101000). Output Write…
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For example:Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 return its bottom-up level or…
题目链接:http://acm.sgu.ru/problem.php?contest=0&problem=455 Due to the slow 'mod' and 'div' operations with int64 type, all Delphi solutions for the problem 455 (Sequence analysis) run much slower than the same code written in C++ or Java. We do not gua…