![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
比赛补题
KEMNHan
希望工作955,管吃住,生活设施齐全,有零食,小姐姐多,写不出bug
展开
-
Infinity Set (gcd+暴力打表)
Little A likes infinite set very much, so he creates a infinite set.First, two numbers (may same) was added into an empty set. Next, if numbers xx and yy are in this set, x+yx+y was added into this ...原创 2018-11-01 18:43:13 · 291 阅读 · 0 评论 -
2019湘潭邀请赛 Build Tree
贪心模拟,边权越小越靠近根节点。#include<bits/stdc++.h>using namespace std;typedef long long ll;const int maxn=200010;ll s[maxn];int k,m,n;ll p;int powermod(int x,int n){ int res=1; while(n...原创 2019-05-22 10:00:16 · 212 阅读 · 0 评论 -
Angel's Journey(圆外一点到圆上一点的距离,不经过圆内)
#include<bits/stdc++.h>using namespace std;typedef long long ll;const double pi=acos(-1.0);double rx,ry,r,x,y;double s;double len1(double a,double b,double c,double d){ retu...原创 2019-05-26 15:40:54 · 376 阅读 · 0 评论 -
HDU - 5909 Tree Cutting FWT+树形dp(点分治不会)
Byteasar has a treeTTwithnnvertices conveniently labeled with1,2,...,n1,2,...,n. Each vertex of the tree has an integer valuevivi.The value of a non-empty treeTTis equal tov1⊕v2⊕...⊕vnv1⊕v2...原创 2019-06-04 17:01:00 · 136 阅读 · 0 评论 -
ZOJ Summer 2018 #include <list>
For a sequenceX.Xn+1= (a*Xn+c) %p. Now givena,c,X0,n,p, you need to calculateXn.InputThe first line contains an integerT, indicating that there areTtest cases (T<= 20);Fo...原创 2019-07-08 19:06:19 · 110 阅读 · 0 评论 -
ZOJ Summer 2018 1020
#include <deque>There is a deque of sizenand you want to use it now, but unfortunately it's not empty yet. So, before using it, you're forced to do this boring work: clear it.Each ti...原创 2019-08-02 10:07:33 · 136 阅读 · 0 评论 -
Miner's Necklace
#include<bits/stdc++.h>using namespace std;typedef long long ll;typedef unsigned long long ull;const int maxn=1e6+5;int n,m;int s[maxn],t[maxn];int vis[maxn],next[maxn];int fs[max...原创 2019-07-10 20:43:15 · 108 阅读 · 0 评论 -
Wheat
#include<bits/stdc++.h>using namespace std;#define Inc(i,L,r) for(register int i=(L);i<=(r);++i)#define Red(i,r,L) for(register int i=(r);i>=(L);--i)const int N = 1e4+10,Maxsiz ...原创 2019-07-10 21:42:30 · 134 阅读 · 0 评论 -
zoj Sky_miner and Odious Number
1, 2, 4, 7, 8, 11, 13, 14, 16, 19, 21, 22, 25, 26, 28, 31, 32, 35, 37, 38, 41, 42, 44, 47, 49, 50, 52, 55, 56, 59, 61, 62, 64, 67, 69, 70, 73, 74, 76, 79, 81, 82, 84, 87, 88, 91, 93, 94, 97, 98, 1...原创 2019-07-11 14:30:12 · 107 阅读 · 0 评论 -
Saber
Saber is a Class in the Holy Grail War. This Class is regarded as one of the most powerful Class.Saber is a tree-lover. She loves all kinds of trees. One day, she suddenly comes up with a curious ...原创 2019-07-06 13:05:34 · 409 阅读 · 0 评论 -
C - Emergency Evacuation
题目链接:GYM108082题意:一群人从位置上通过逃生通道离开,通道不能并行,只能单人有序通行,求全部人出去的最小时间题解:每个人的路线都是固定的,那么只要前方有空位就走,没空位就等着,然后我们考虑一下每个人的路线,如果这两个人在没有阻挡的情况下,到达终点的时间是是一样的话,那么必定会在某一点相遇,此时就需要有一个人要等一个时刻,如果有第三个人的话,这第三个就要等两个时刻,那么我...原创 2019-07-29 11:04:22 · 265 阅读 · 0 评论 -
杭电多校 Fansblog
FansblogTime Limit: 2000/2000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 3170Accepted Submission(s): 671Problem DescriptionFarmer John keeps a websi...原创 2019-07-30 09:57:39 · 153 阅读 · 0 评论 -
牛客多校 generator 1
题意:求fn的第1e10e6项,用广义欧拉降幂了半天都wa,后来才知道时十进制快速幂,nnd第一次知道这玩意构造矩阵:|a,b||1,0|然后跑一下十进制快速幂就好了#include<bits/stdc++.h>using namespace std;typedef long long ll;#define mp make_pairty...原创 2019-08-02 13:21:09 · 161 阅读 · 0 评论 -
2019年湘潭大学程序设计竞赛
A:Who's better?暴力,没啥好说的。。#include<bits/stdc++.h>typedef long long ll;using namespace std;const int maxn=50005;int main(){ int a,b,c; int x,y,z; cin>>a>>b>&...原创 2019-05-05 14:14:09 · 407 阅读 · 0 评论 -
ZOJ-Intervals
题意:最少拿走哪几个区间可以保证覆盖区间三个内至少有一对不相交贪心做法,根据左端点进行排序,右端点大的优先被拿走,影响最小的保留,三个排序判断位置,队列维护下index数组存一下下标。#include<bits/stdc++.h>#define LL long longusing namespace std;const int maxn=50005;i...原创 2019-04-23 21:17:23 · 132 阅读 · 0 评论 -
ACM-ICPC北京赛区(2017)网络赛 Minimum(线段树)
题解:线段树模板题,线段树维护一个区间最小值和区间最大值。因为数组元素可能为负所以答案一定是: max*max、 max*min、min*min中的最小值。那么只要维护区间最小值的同时维护最大值,最后求最小值就好了#include<bits/stdc++.h>using namespace std;typedef long long ll;const int MAX...原创 2018-11-09 13:22:23 · 188 阅读 · 0 评论 -
牛客寒假算法基础集训营4
A Applese 的取石子游戏 Applese 和 Bpplese 在玩取石子游戏,规则如下:一共有偶数堆石子排成一排,每堆石子的个数为 aiai。两个人轮流取石子,Applese先手。每次取石子只能取最左一堆或最右一堆,且必须取完。最后取得的石子多者获胜。假设双方都足够聪明,最后谁能够获胜呢?输入描述:第一行是一个正偶数 n,表示石子的堆数。第二行是 n...原创 2019-02-01 17:52:59 · 316 阅读 · 0 评论 -
守望者的逃离
大爷的,鬼知道想明白了以后以后不是什么鸡儿dp,也不用搜索。。。完全就是分类讨论,然后罗列下ififif就好了嘤嘤嘤#include <bits/stdc++.h>using namespace std;int main(){ int m,s,t; cin>>m>>s>>t; int ss=0,tt=t;...原创 2019-02-09 00:45:29 · 836 阅读 · 0 评论 -
采药 非dp
描述辰辰是个很有潜能、天资聪颖的孩子,他的梦想是称为世界上最伟大的医师。为此,他想拜附近最有威望的医师为师。医师为了判断他的资质,给他出了一个难题。医师把他带到个到处都是草药的山洞里对他说:“孩子,这个山洞里有一些不同的草药,采每一株都需要一些时间,每一株也有它自身的价值。我会给你一段时间,在这段时间里,你可以采到一些草药。如果你是一个聪明的孩子,你应该可以让采到的草药的总价值最大。”如果你是...原创 2019-02-09 01:01:44 · 72 阅读 · 0 评论 -
榨取kkksc03 二维dp
洛谷的运营组决定,如果一名oier向他的教练推荐洛谷,并能够成功的使用(成功使用的定义是:该团队有20个或以上的成员,上传10道以上的私有题目,布置过一次作业并成功举办过一次公开比赛),那么他可以浪费掉kkksc03的一些时间的同时消耗掉kkksc03的一些金钱以满足自己的一个愿望。Kkksc03的时间和金钱是有限的,所以他很难满足所有同学的愿望。所以他想知道在自己的能力范围内,最多可以完成多...原创 2019-02-25 20:59:28 · 167 阅读 · 0 评论 -
3的幂的和
Description求:3^0 + 3^1 +...+ 3^(N) mod 1000000007。 Input每行一个整数N(0 <= N <= 10^9) Output输出:计算结果 Sample Input3Sample Output40 #include <bits/stdc++.h>using na...原创 2019-02-26 19:50:32 · 685 阅读 · 0 评论 -
Little Sub and Triples
Little Sub has learned a new word ’Triple’, which usually means a group with three elements in it. Now he comes up with an interesting problem for you.Define F(a,b,c) = e^a∗e^b / e^cGiven an posit...原创 2019-03-18 12:30:29 · 290 阅读 · 0 评论 -
Monitor
Problem DescriptionXiaoteng has a large area of land for growing crops, and the land can be seen as a rectangle ofn×m.But recently Xiaoteng found that his crops were often stolen by a group of pe...原创 2019-04-21 21:25:43 · 188 阅读 · 0 评论 -
MORE XOR(南昌邀请赛网络赛)
根据题意,打表w(l,r),观察对异或和值有贡献的数;根据结果可以发现,当len(len=R-L+1) %4=0的时候,区间内值对于异或和值无任何贡献,*1,即len%4=0的时候,VAL_XOR=0;*2,对于len%4=1的时候,VAL_XOR=a[l]+a[l+4]+....+a[R]*3,对于len%4=2的时候,VAL_XOR=a[l]+a[l+4]+.......原创 2019-04-22 12:42:35 · 170 阅读 · 0 评论 -
Schrödinger's Knapsack
DreamGrid has a magical knapsack with a size capacity ofcalled the Schrödinger's knapsack (or S-knapsack for short) and two types of magical items called the Schrödinger's items (or S-items for shor...原创 2019-04-22 21:03:13 · 340 阅读 · 0 评论 -
Mergeable Stack
模拟题,题意:给你三种操作1.将v压入第s个队列2.弹出s队列最后一个,s为空的话输出empty3.将t队列放到s队列后面一开始没想到操作三的splice,t了#include<bits/stdc++.h>using namespace std;const int maxn=3e5+5;vector<list<int> &...原创 2019-04-22 21:12:08 · 197 阅读 · 0 评论 -
Space Ant 极角排序
题意:给定n个点,任意两点不在一个x轴和y轴上,输出一条能经过最多点的路线,就下面这图,每次只能左转,实际就是外面一圈包进去,选择一个最外侧点,对剩下点做极角排序,一个个点选下去。能保证每个点都经过。#include<stdio.h>#include<iostream>#include<math.h>#include<...原创 2019-09-25 21:00:20 · 162 阅读 · 0 评论