HDU 4228 Flooring Tiles 反素数】的更多相关文章

推出了结论,万万没想到最后用搜索.. 还想dp来着.. #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #include <math.h> #include <set> #include <vector> #include <map> using namespace std; #define ll lon…
反素数: 对于不论什么正整数x,起约数的个数记做g(x).比如g(1)=1,g(6)=4. 假设某个正整数x满足:对于随意i(0<i<x),都有g(i)<g(x),则称x为反素数. ZOJ 2562 反素数 由于写了POJ 2886的线段树.然后里面有反素数,曾经没遇到过,所以先搞这两题普及一下知识再说. #include<iostream> #include<cstdio> #include<cstring> #include<algorith…
1558: Flooring Tiles 时间限制: 3 Sec  内存限制: 128 MB提交: 59  解决: 36[提交][状态][讨论版] 题目描述 You want to decorate your floor with square tiles. You like rectangles. With six square flooring tiles, you can form exactly two unique rectangles that use all of the tile…
Problem Description 反素数就是满足对于任意i(0< i < x),都有g(i) < g(x),(g(x)是x的因子个数),则x为一个反素数.现在给你一个整数区间[a,b],请你求出该区间的x使g(x)最大. Input 第一行输入n,接下来n行测试数据 输入包括a,b, 1<=a<=b<=5000,表示闭区间[a,b]. Output 输出为一个整数,为该区间因子最多的数.如果满足条件有多个,则输出其中最小的数. Sample Input 3 2 3…
传送门 参考资料: [1]:https://blog.csdn.net/acdreamers/article/details/25049767 题意: 输入两个数 type , k: ①type = 0,求[1,262]中的因子个数为 k 的反素数,如果求解的答案 > 262,输出"INF": ②type = 1,求使得 num-factor[num] = k 的最小的num: 题解: 只有当 type = 1 时,才有可能输出 "Illegal": 那,什么…
解题报告:水题,直接附上代码,只是觉得这题的作者是不是吃饱了饭撑的,反素数的概念跟这题一点关系都没有. #include<cstdio> int judge1(int k) { ; ;i<=k;++i) if(!(k%i)) tot++; return tot; } int main( ) { int n,a,b; scanf("%d",&n); while(n--) { scanf("%d%d",&a,&b); int M…
小明系列故事——未知剩余系 Time Limit: 500/200 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Problem Description “今有物不知其数,三三数之有二,五五数之有三,七七数之有二,问物几何?” 这个简单的谜题就是中国剩余定理的来历. 在艰难地弄懂了这个定理之后,小明开始设计一些复杂的同余方程组X mod ai = bi 来调戏别人,结果是必然的,都失败了. 可是在这个过程中,小明发现有…
反素数 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5723    Accepted Submission(s): 3355 Problem Description 反素数就是满足对于任意i(0<i<x),都有g(i)<g(x),(g(x)是x的因子个数),则x为一个反素数.现在给你一个整数区间[a,b],请你求出该区间的x使…
反素数: 对于任何正整数,其约数个数记为,例如,如果某个正整数满足:对任意的正整 数,都有,那么称为反素数. 有两个特点: 1.一个反素数的质因子必是从2开始的质数 2.如果,那么必有 最常见的问题如下: (1)给定一个数,求一个最小的正整数,使得的约数个数为 (2)求出中约数个数最多的这个数 即是通过搜索建立一个搜索树,递归出合适的所有的情况,再加上剪枝. ZOJ2562 题意: 给定一个数N,求小于等于N的所有数当中,约数最多的一个数,如果存在多个这样的数,输出其中最大的一个. #inclu…
Time Limit: 5000MS Memory Limit: 131072K Case Time Limit: 2000MS Description N children are sitting in a circle to play a game. The children are numbered from 1 to N in clockwise order. Each of them has a card with a non-zero integer on it in his/her…