#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阅读
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阅读
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阅读
题意:找到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评论
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评论
题意是说给出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评论
可以很简单的发现,当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评论
Select:和SQL命令中的select作用相似但位置不同,查询表达式中的select及所接子句是放在表达式最后并把子句中的变量也就是结果返回回来;延迟.
Select/Distinct操作包括9种形式,分别为简单形式、匿名类型形式、带条件形式、指定类型形式、过滤类型形式、shaped类型形式、嵌套类型形式、LocalMethodCall形式、Distinct
转载
2024-05-18 06:35:32
54阅读
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阅读
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阅读
import pymongoclient = pymongo.MongoClient('192.168.0.136',27017) db = client.fangjia_statcl=db.rent_average_lg1013.distinct("city")ll=list(cl)print(ll)
原创
2023-01-13 00:26:35
95阅读
一、记录要点1.select <列名><列名> from <表名>2.*可以代表所有列3.用as 设置别名,如select 姓名 as s_name, 姓名 as '人类性别' from student4.distinct(用来删除一列中的重复数据),单列之前,是select distinct 姓名 from student,多列之前,组合相同才删除重点注意:列
转载
2024-05-29 06:01:17
156阅读
首先对于MySQL的DISTINCT的关键字的一些用法:1.在count 不重复的记录的时候能用到,比如SELECT COUNT( DISTINCT id ) FROM tablename;就是计算talbebname表中id不同的记录有多少条。2,在需要返回记录不同的id的具体值的时候可以用,比如SELECT DISTINCT id FROM tablename;返回talbebname表中不同
转载
2024-01-21 06:27:42
60阅读
背景 为什么需要调优?? 程序都是能跑的,集群还是那个集群,但是有可能另外一个会调优的人和你写的代码的运行的速度要几倍甚至几十倍1.开发调优1.1 原则一:避免创建重复的RDD我们有一份数据 ,student.txt 第一个需求 :wordCount val stuRDD = sc.textFile(“e://sparkData//student.txt”) 第二个需求:算有多少个学生 val s
转载
2024-06-21 09:18:38
157阅读