D. Magic Numbers 题目连接: http://www.codeforces.com/contest/628/problem/D Description Consider the decimal presentation of an integer. Let's call a number d-magic if digit d appears in decimal presentation of the number on even positions and nowhere els…
D. Magic Numbers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Consider the decimal presentation of an integer. Let's call a number d-magic if digit d appears in decimal presentation of…
A. Magic Numbers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of…
主题链接:http://acm.timus.ru/problem.aspx?space=1&num=1727 1727. Znaika's Magic Numbers Time limit: 0.5 second Memory limit: 64 MB Znaika has many interests. For example, now he is investigating the properties of number sets. Znaika writes down some set…
题意: 求在[a,b](a,b不含前导0)中的d−magic数中有多少个是m的倍数. 分析: 计数dp Let's call a number d-magic if digit d appears in decimal presentation of the number on even positions and nowhere else. 仔细读题并观察例子就可以明确d−magic数从左到右所有偶数位置上都是d,奇数位上不能是d. 求[a,b],即可转化为求[1,a],[1,b]中的满足条件…
ZS the Coder and Chris the Baboon arrived at the entrance of Udayland. There is a n × n magic grid on the entrance which is filled with integers. Chris noticed that exactly one of the cells in the grid is empty, and to enter Udayland, they need to fi…
E. Magic Stones time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Grigory has nn magic stones, conveniently numbered from 11 to nn. The charge of the ii-th stone is equal to cici. Sometimes G…
C. Really Big Numbers time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Ivan likes to learn different things about numbers, but he is especially interested in really big numbers. Ivan thinks…
B. Case of Fake Numbers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Andrewid the Android is a galaxy-famous detective. He is now investigating a case of frauds who make fake copies of…
Consider the decimal presentation of an integer. Let's call a number d-magic if digit d appears in decimal presentation of the number on even positions and nowhere else. For example, the numbers 1727374, 17, 1 are 7-magic but 77, 7, 123, 34, 71 are n…
题意:就是n个数和k,每次按顺序那两个数,最大公约数的和为k. 思路:注意:当n=1,k>0时一定不存在,还有n=1,k=0时为1即可. 然后再正常情况下,第一组的最大公约数为k-n/2+1即可,后面是含有素数.(本来,配的是素数和素数+1, 然后会怕第一组会重复,后来直解两个素数了,因为第一组要么是特殊的素数要么是合数所以么有必要担心重复) #include<iostream> using namespace std; #define N int(1e7+10) int prime[N…