Spoj-ODDDIV Odd Numbers of Divisors】的更多相关文章

Given a positive odd integer K and two positive integers low and high, determine how many integers between low and high contain exactly K divisors. Input The first line of the input contains a positive integer C (0<C<100,000), the number of test cas…
给出一个正奇数K,两个正整数low,high. 有多少整数属于[low, high],且包含K个因子. 数据 C(0 < C < 1e5),测试样例数. (1 < K < 10000, 0 < low <= high < 1e10). 输入 3 3 2 49 9 1 100 5 55 235 输出 4 2 1…
题目链接:http://www.spoj.com/problems/BALNUM/en/ Time limit: 0.123s Source limit: 50000B Memory limit: 1536MB Balanced numbers have been used by mathematicians for centuries. A positive integer is considered a balanced number if: 1)      Every even digit…
Balanced Numbers Balanced numbers have been used by mathematicians for centuries. A positive integer is considered a balanced number if: 1)      Every even digit appears an odd number of times in its decimal representation 2)      Every odd digit app…
链接: https://vjudge.net/problem/SPOJ-BALNUM 题意: Balanced numbers have been used by mathematicians for centuries. A positive integer is considered a balanced number if: 1) Every even digit appears an odd number of times in its decimal representation 2)…
题目:http://www.spoj.com/problems/BALNUM/en/ 题意:找出区间[A, B]内所有奇数字出现次数为偶数,偶数字出现次数为计数的数的个数. 分析: 明显的数位dp题,首先,只有3种状态(0:没出现过, 1:数字出现奇数次, 2:数字出现偶数次),所以, 0~9 出现的次数就可以用3进制表示,最大的数就是 310 ,那么我们就可以把1019 哈希到310 内了.其中,我们可以假设: (0:30  ,1:31 , 2:32 , .... , 9: 39 ) 当第一次…
This is simply a human work simulation - exactly reproducing how you do it by hand. Nothing special. You'd better put each step on a paper to make everything clear. Reference: http://blog.csdn.net/rappy/article/details/1737671 My code passed all 6 te…
题目链接 一个数称为平衡数, 满足他各个数位里面的数, 奇数出现偶数次, 偶数出现奇数次, 求一个范围内的平衡数个数. 用三进制压缩, 一个数没有出现用0表示, 出现奇数次用1表示, 出现偶数次用2表示, 这样只需要开一个20*60000的数组. #include<bits/stdc++.h> using namespace std; #define pb(x) push_back(x) #define ll long long #define mk(x, y) make_pair(x, y)…
意甲冠军: 给k(1<=k<=10^15),先询问k 大只包含数字5和6的数目是多少 实例 1那是,5 ,3那是,55 .4那是,56 思考: 首先,我们可以找到.有许多2这是头号,有两个数字4个月.有三位数8个月.. 那么我们能够通过统计确定出第k大的数是几位的. 通过累和.一位数下面0个,两位数下面2.三位数下面6 n位数下面就是2^n-2 然后给k,从大到下搜索第一个小于k的bit[i],那么就有i位数. 然后就是对于i位数.它是第几个数. 比方说k=70.它就是6位数. 然后 70-b…
题意:给定x.y.为[x,y]之间有多少个数的偶数位和减去奇数位和等于一. 个位是第一位. 样例: 10=1-0=1 所以10是这种数 思路:数位dp[i][sum][ok] i位和为sum 是否含有前导0. 然后就是由于有负数 所以依据范围把0设置为100 然后最后和等于101则为所求的数. 代码: #include"cstdlib" #include"cstdio" #include"cstring" #include"cmath&…