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 ...
随机推荐
- android的liveview装载数据
设置布局 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:andro ...
- JS中判断JSON数据是否存在某字段的方法 JavaScript中判断json中是否有某个字段
方式一 !("key" in obj) 方式二 obj.hasOwnProperty("key") //obj为json对象. 实例: var jsonwor ...
- JQuery 事件器的介绍
基本用法 $(元素). 事件( 事件属性); 常见事件 示例 说明 $(selector).click() 被选元素的点击事件 $(selector).dblclick() 被选元素的双击事件 $ ...
- 温故知新——json
Json简介 Json(JavaScript Object Notation)是一种轻量级的数据交换格式.它是基于javascript(Standard ECMA-262 3rd Edition - ...
- Python中map,filter,reduce,zip的应用
事例1: l=[('main', 'router_115.236.xx.xx', [{'abc': 1}, {'dfg': 1}]), ('main', 'router_183.61.xx.xx', ...
- EasyUI portal自定义小图标,不是用js方式加载
<script src="~/Scripts/jquery.portal.js"></script> <script> $(function ( ...
- online web design tool
https://webflow.com/ http://css-tricks.com/snippets/ https://www.fluidui.com/demos
- 图像混合学习。运用加权函数,学习opencv基础操作
{ cout<< } { cout<< } ,,logoImage.c ...
- NPOI常用功能工具类
public class NPOIHelper { /// <summary> /// DataTable导出到Excel文件 /// </summary> /// <p ...
- Unity3D游戏UI开发经验谈
原地址:http://news.9ria.com/2013/0629/27679.html 在Unity专场上,108km创始人梁伟国发表了<Unity3D游戏UI开发经验谈>主题演讲.他 ...