The Super Powers 以后还要记得再自己写恩!!!/*#include<iostream>#include<cm
翻译 2022-08-22 21:21:42
47阅读
很难证明出这个合法数列最大值就是3。。然后就好做了假设存在四个数x , x+2^i ,x + 2^j , x + 2^lx+2^j - x-2^i = 2^j - 2^i 要是2的整数倍 j=i+1; 同理 l=j+1 那么第二个数和第四个数就不满足差值是2的幂了QUQ。#include<iostream>#include<cstring>#include<vector>#include<algorithm>#include<map.
原创 2021-07-09 14:04:54
407阅读
Three powersTime Limit:1sMemory limit:32MAccepted Submit:96Total Submit:217Consider the set of all non-negative integer powers of 3.  S = { 1, 3, 9, 27, 81, .
原创 2021-08-20 14:51:30
79阅读
In Haskell. Two points: 1. pruning 2. Int suffers from overflow. Integer it is.getPowerSum :: Integer -> [Integer] -> Integer -> IntegergetPowerSum _ ...
转载 2015-03-03 03:16:00
150阅读
2评论
题意:找到k个数,并且都是2的多少次幂,这k个数相加等于n,不需要按顺序。思路:看k>n,输出NO,如果k<n,先找出最少的情况所需要数的个数(就
原创 2022-01-10 10:57:13
92阅读
标题手段:他给了一个无限Pascal阵,定义了powers,然后询问power为P的pascal矩阵里面的第R行C列的元素是多少。最開始读错题意了...然后 就成了一个神得不得了的题了。后来请教的别人。感觉能够用矩阵高速幂做。然后,不用高速幂的话,你会惊奇的发现,变成了找规律的题了...答案成了co...
转载 2015-08-08 08:37:00
47阅读
2评论
可以很简单的发现,当n是奇数的时候,f(n)=φ(n),否则f(n)=0。 所以我们就是求n<=5*10^8且n为奇数的φ的和。 首先我们可以做到用杜教筛算出φ的前缀和,但是如何把偶数的减去? 我们设h(x)为1<=n<=x且n为偶数的φ的和,可以得到: h(x)=Σ(1<=i<=x/2) φ(i)
转载 2018-03-06 10:02:00
63阅读
2评论
#include<bits/stdc++.h>using namespace std;#define rep(i,l,r) for(int i=(l);i<=(r);i++)#define per(i,l,r) for(in
原创 2022-08-16 14:39:12
44阅读
Perfect Pth PowersTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 14512Accepted: 3263DescriptionWe say that x is a perfect square if, for some integer b, x = b2. Similarly, x is a perfect cube if, for some integer b, x = b3. More generally, x is a perfect pth power if, for some integer b, x
原创 2021-07-29 16:22:06
160阅读
11752 - The Super PowersTime limit: 1.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=467&page=show_problem&problem=2852We all know the Super Powers
原创 2023-04-12 05:49:31
111阅读
Distinct powersProblem 29Consider all integer combinations of ab for 2 ≤ a ≤ 5 and 2 ≤ b ≤ 5:22=4, 23=8, 24=16, 25=3232=9, 33=27, 34=81, 35=24342=16, 43=64, 44=256, 45=102452=25, 5
原创 2022-08-11 15:18:49
25阅读
Self powersProblem 48The series, 11 + 22 + 33 + ... + 1010 = 10405071317.Find the last ten digits of the series, 11 + 22 + 33 + ... + 10001000.Answer:9110
原创 2022-08-11 16:55:56
33阅读
题意是说给出n , k 求出最大的 i 使得 n! % k^i == 0 ...     假设
原创 2022-08-12 13:07:12
26阅读
#include #inclu #include #define OUT freopen("out.txt", "w", stdout) using namespace std; typedef unsigned long long ull; const double key = log(1.0 * ULON
原创 2022-08-17 15:41:54
41阅读
#include<iostream>#include<math.h>using namespace std;#define eps 1e-2 //其他精度数也同样可以int main(){ int n; while(cin>>n&&n) { //n有负数的可能,比如 -1073741824,正解应该是 15, (-4)^15=-1073741824 int t=n>0?1:-1; for(int i=31;i>=1;--i) { double x=ceil(pow(double(n)*t,1.0/i))*t; //向上取整 dou
转载 2011-07-22 22:47:00
33阅读
2评论
作为愚人节专题 这题貌似是要根据WA的数据...
转载 2016-04-07 21:55:00
52阅读
Self powersProblem 48The series, 11 + 22 + 33 + ... + 1010 = 10405071317.Find the last ten digits of the series, 11 + 22 + 33 + ... + ...
转载 2017-03-19 09:00:00
31阅读
2评论
题解: 将一个数的指数看着一个堆,问题变成这些堆的异或值 分析一个堆的情况,打SG表。#include#includechar sg[1100000000];char getsg(int x){ if(sg[x]>=0) return sg[x]; bool hash[20]= {0...
转载 2013-10-12 20:43:00
61阅读
2评论
题意: 求1~2^64-1之间所有的 至少是两个不同的正整数的幂的数 升序输出 一个数的合数次幂即为这样的数 找出1~2^64-1中所有数的合数次幂 用set存起来(既能防止重复 又能升序) 最后输出就好了
转载 2018-07-16 18:13:00
52阅读
2评论
Perfect Pth PowersTime Limit:1000MSMemory Limit:10000KTotal Sub
转载 2012-03-31 11:03:00
140阅读
2评论
  • 1
  • 2
  • 3
  • 4
  • 5