2017杭电多校第六场1008 Kirinriki】的更多相关文章

传送门 Kirinriki Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1012    Accepted Submission(s): 400 Problem Description We define the distance of two strings A and B with same length n isdisA,B=∑…
传送门 Classes Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 0    Accepted Submission(s): 0 Problem Description The school set up three elective courses, assuming that these courses are A, B, C.…
传送门 Inversion Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 0    Accepted Submission(s): 0 Problem Description Give an array A, the index starts from 1. Now we want to know Bi=maxi∤jAj , i≥2.…
Rikka with Competition Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 445    Accepted Submission(s): 366 Problem Description As we know, Rikka is poor at math. Yuta is worrying about this situ…
Rikka with Subset Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1440    Accepted Submission(s): 721 Problem Description As we know, Rikka is poor at math. Yuta is worrying about this situatio…
#include<bits/stdc++.h>using namespace std;int a[100010];char s[20];int zhiren[100010];vector<int>haoren[100010];int sum=0;void dfs(int x,int y,int flag){    if(x==y)        flag=1;//如果和被指认的人相同,则定为狼    sum+=flag;//并且后面直接或间接认为刚才那个是狼的人是好人的人也都是狼 …
Kolakoski Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 0    Accepted Submission(s): 0 Problem Description This is Kolakosiki sequence: 1,2,2,1,1,2,1,2,2,1,2,2,1,1,2,1,1,2,2,1--. This seque…
Euler theorem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 0    Accepted Submission(s): 0 Problem Description HazelFan is given two positive integers a,b, and he wants to calculate amodb.…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6641 题意为求出最小的n,满足(f(n,m)-n)^n=k,其中f(n,m)为第m大的x,其中x满足gcd(x,n)==1且x>n. 可以将式子化成f(n,m)=k^n+n,然后我们会发现f(n,m)的范围大致会在(n+1,n+loglogn)之间,因为f(n,m)内最多会有m个质数,质数的密度. 所以可以枚举k^n,k^n^k=n. #include<iostream> #include&…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6638 题意为在一个平面上任意选择一个长方形,使得长方形内点权和最大. 因为长方形可以任意选择,所以上下边一定在某些点上.所以可以枚举上下边. 将上下边看成一条直线y,上下边之间的点看成直线y上的点,则题意就转化成求直线y上最大子段和(子段和的左右边界即是长方形的左右边). 用线段树维护(区间和&最大前缀和&最大后缀和)就可以维护得到区间最大子段和. 显然需要离散化(雾 #include<…