UVa 11752 - The Super Powers 数学
请看这个说明http://blog.csdn.net/u014800748/article/details/45914353
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<queue>
#include<cstdlib>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
bool vis[];
set<ULL>s;
int main()
{
int prime[] = { , , , , , , , , , , , , , , , , , };
for (int i = ; i < ; i++)
vis[prime[i]] = ;
ULL lim = ~0LL >> ;
s.clear();
for (ULL i = ;; ++i){
ULL cnt = -, x = lim;
while (x){
x /= i;
cnt++;
}
if (cnt < )break;
ULL b = i;
for (ULL j = ; j <= cnt; ++j){
b *= i;
if (!vis[j])
s.insert(b);
}
}
s.insert();
set<ULL>::iterator it;
for (it = s.begin(); it != s.end(); it++)
cout << *it << '\n';
return ;
}
UVa 11752 - The Super Powers 数学的更多相关文章
- UVA 11752 The Super Powers —— 数学与幂
题目链接:https://vjudge.net/problem/UVA-11752 题解: 1.首先变量必须用unsig long long定义. 2.可以分析得到,当指数为合数的时候,该值合法. 3 ...
- uva 11752 The Super Powers 素数+大数判断大小
题目链接: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_proble ...
- uva 11752 - The Super Powers
这个题 任意一个数,他的幂只要不是质数则可以分解成两个数的乘 判断有没有溺出 i×i 则用最大的那个数 Max/i < i 吗 #include<iostream> #i ...
- uva 11752 The Super Powers (数论+枚举)
题意:找出1~2^64-1中 能写成至少两个数的幂形式的数,再按顺序输出 分析:只有幂是合数的数才是符合要求的.而幂不会超过64,预处理出64以内的合数. 因为最小的合数是4,所以枚举的上限是2的16 ...
- UVA 11752 The Super Powers【超级幂】
题目链接: http://acm.hust.edu.cn/vjudge/contest/view.action?cid=111527#problem/Z 题意: 我们称一个可以由至少两个不同正整数的幂 ...
- UVA 11752 The Super Powers(暴力)
题目:https://cn.vjudge.net/problem/UVA-11752 题解:这里只讨论处理越界的问题. 因为题目最上界是 264-1. 我们又是求次幂的. 所以当我们就可以知道 i 的 ...
- The Super Powers UVA 11752 分析分析 求无符号长整形以内的数满足至少可以用两种不同的次方来表示。比如64 = 2^6 = 8^2; 一个数的1次方不算数。
/** 题目:The Super Powers UVA 11752 链接:https://vjudge.net/contest/154246#problem/Y 题意:求无符号长整形以内的数满足至少可 ...
- UVA 10622 - Perfect P-th Powers(数论)
UVA 10622 - Perfect P-th Powers 题目链接 题意:求n转化为b^p最大的p值 思路:对n分解质因子,然后取全部质因子个数的gcd就是答案,可是这题有个坑啊.就是输入的能够 ...
- The Super Powers
The Super Powers Time Limit: 1000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu [Subm ...
随机推荐
- 图片裁切插件jCrop的使用心得(二)
上一篇简单的介绍了一下开发的背景以及一些学习资料,下面开始介绍如何上手. 一.下载jCrop http://deepliquid.com/content/Jcrop_Download.html 直接去 ...
- Cassandra1.2文档学习(2)——节点间通信协议之gossip协议
参考文档:http://www.datastax.com/documentation/cassandra/1.2/webhelp/index.html#cassandra/architecture/a ...
- php练习1——计算器
目标:输入两个数,计算两个数的和/差/积/商 程序如下:两个文件jiSuanQi.html和jiSuanQi.php 结果如下:
- php实现单链表
<?php /** * 单链表 */ class Demo { private $id; public $name; public $next; public function __constr ...
- jquery中交替点击事件toggle方法的使用示例
jquery中交替点击事件toggle方法中有两个参数,分别是要交替执行的事件.如果不传参默认是显示隐藏功能,下面有个不错的示例,感兴趣的朋友可以参考下 复制代码代码如下: $('#clickId‘) ...
- PHP初学留神(四)
这周去听了Google的演讲,从Idea到Code的商业宣传.不过因为是头一次听英文演讲,心里还是很舒服.这周主要做的是Bootstrap前端美化,这个框架也比较好玩.在php上面花的时间相对少了,也 ...
- UILocalNotification本地通知
// 执行通知一定要退出应用或挂起应用(进入后台)才能收到通知. 1.在iOS8及其以后版本中使用本地消息需要先获得用户的许可,否则无法成功注册本地消息.因此,我们将询问用户许可的代码片段添加到了ap ...
- MVC5添加控制器总是报“Multiple object sets per type are not supported”
http://www.asp.net/mvc/tutorials/mvc-5/introduction/creating-a-connection-string 按照上面的指导做练习, 总报小面的错 ...
- bzoj 4127: Abs 树链剖分
4127: Abs Time Limit: 40 Sec Memory Limit: 256 MBSubmit: 11 Solved: 5[Submit][Status][Discuss] Des ...
- 卡牌手游源码《暗黑世界V1.3》数据库表说明文档!!!
原地址:http://blog.csdn.net/uxqclm/article/details/11970761 欢迎来到9秒:www.9miao.com 由于看到论坛中有人询问需求<暗黑世界V ...