- 博客(17)
- 收藏
- 关注
原创 NKOJ 2150 广告印刷 单调队列
【单调队列】广告印刷Time Limit:10000MS Memory Limit:65536KTotal Submit:296 Accepted:108 Case Time Limit:1000MSDescription最近,afy决定给TOJ印刷广告,广告牌是刷在城市的建筑物上的,城市里有紧靠着的N(NInput第一行,一个整数N 第二行,N个空格间隔的整数,
2016-06-15 06:56:10 1412 3
原创 FOJ 1894 志愿者选拔 单调队列
还是利用优先队列乱搞23333//为什么foj不能用万能头文件orzACcode:#include #include #include #include #define maxn 1000010#define ll long longusing namespace std;char s[11];ll a[maxn],tot,num;struct cmp{ bool
2016-06-14 19:45:58 912
原创 RQNoj 合并果子 优先队列最小堆
题意:每次选最小的2个合并ACcode:#include #define maxn 10010using namespace std;struct cmp{ bool operator()(const int a,const int b){ return a>b; }};int main(){ int n,a; while(~s
2016-06-14 19:02:58 627
原创 poj 2823 Sliding Windows 线段树|单调队列
题意:给你一个长为n的数组求任意连续长为k的子区域最大最小值 区间极值,很裸的线段树。但是正解应该是单调队列,单调队列比线段树快近一倍,因为充分利用之前计算的值。线段树差点超时ACcode:#include #include #include #define maxn 1000100#define tmp (st<<1)#define mid ((l+r)
2016-06-14 18:39:06 379
原创 湘潭邀请赛 A题 矩阵快速幂
2016Given a 2×2 matrixA=(a11a21a12a22),find An where A1=A,An=A×An−1. As the result may be large, you are going to find only the remainder after division by 7.Special Note: The proble
2016-06-13 12:46:34 838
原创 HDU 5443 The Water Problem 线段树
裸的区间求最大值ACcode:#include #include #include #include #define tmp (st<<1)#define mid ((l+r)>>1)#define lson l,mid,tmp#define rson mid+1,r,tmp|1#define push_up(x) sum[x]=max(sum[tmp],sum[tmp|1
2016-06-11 13:48:07 414
原创 HDU 5442 Favorite Donut 后缀数组
题意: 给你一个甜甜圈,可以正着次也可以反着次求如何按照字典序最大次后缀数组正反跑一跑就好了ACcode:#include #define maxn 20200using namespace std;int t1[maxn<<1],t2[maxn<<1],c[maxn<<1];int r[maxn<<1],sa[maxn<<1],h[maxn<<1],str[maxn<<1
2016-06-11 13:33:01 336
原创 HDU 5438 Ponds
题意:给你n个点m条边。每次删除度为一的点和其对应的边,如果有新的度为一的点就继续前面的操作。最后输出各个联通分量中个数为奇数的点权和ACcode:#include #include #include #include #define ll long long int#define maxn 100005using namespace std;struct N{i
2016-06-11 13:30:01 311
原创 山东第7届省赛 G Triple Nim 找规律
Triple NimTime Limit: 2000MS Memory limit: 65536K题目描述Alice and Bob are always playing all kinds of Nim games and Alice always goes first. Here is the rule of Nim game: There are som
2016-06-10 19:55:02 846
原创 山东第7届省赛 J题 Execution of Paladin
没玩过炉石,不想看这题,做的太晚了,应该早点做的。Execution of PaladinTime Limit: 2000MS Memory limit: 65536K题目描述Murloc is a powerful race in Hearthstone. In the set League of Explorers, a new Paladin abil
2016-06-10 19:50:12 966
原创 山东第7届省赛 K题 Reversed Words
Reversed WordsTime Limit: 2000MS Memory limit: 131072K题目描述Some aliens are learning English. They have a very strange way in writing that they revered every word in the sentence but keep
2016-06-10 19:40:49 511
原创 山东省第7届ACM省赛 F题 Feed the monkey dp
傻逼记忆化搜索 可是比赛时候我没去敲 赛后1A什么的还是退坑的好Feed the monkeyTime Limit: 2000MS Memory limit: 131072K题目描述Alice has a monkey, she must feed fruit to the monkey every day.She has three
2016-06-10 19:35:49 1167 2
原创 山东省第7届省赛 E题 The Binding of Isaac
The Binding of IsaacTime Limit: 2000MS Memory limit: 65536K题目描述Ok, now I will introduce this game to you...Isaac is trapped in a maze which has many common rooms…Li
2016-06-10 19:31:41 687
原创 山东省第7届省赛 B题 Fibonacci
FibonacciTime Limit: 2000MS Memory limit: 131072K题目描述Fibonacci numbers are well-known as follow: Now given an integer N, please find out whether N can be represented as the sum of se
2016-06-10 19:27:38 717
原创 山东省第7届省赛 A题 Julyed
JulyedTime Limit: 2000MS Memory limit: 65536K题目描述 Julyed is preparing for her CET-6. She has N words to remember, but there is only M days left. If she can’t remember all these words,
2016-06-10 19:22:12 444
原创 记第一次参赛
大二了第一次正式参赛就是省赛,做的火车卧铺去的济南。一晚上晃的不行,到了济南就早上6点了,然后做车去宾馆。到了宾馆半个小时才把房间分配好,发现宾馆的网好的不行,拿出电脑开始补番。看不到一会就睡着了- -,然后就是起床去山师。话说山师真的在山里面啊!好多妹子,qaq看都看不过来,而且比我们学校大了。 然后被志愿者妹子带去次午饭,饭菜还不错。然后就是准备打4C,然后发现山师的任意一个机房都比我
2016-06-10 17:00:39 575
原创 sdut 无尽走廊
无尽走廊Time Limit: 1000MS Memory limit: 65536K题目描述 2006年,我们可以称之为“帆“船年。一艘艘友谊的小船都在这一年翻掉了(当然也有升华为巨轮的)。然而这种事注定与小鱼无缘,就在不久前,小鱼与小驴刚吵了一架,在争吵的过程中,小鱼与小驴友谊的小木船失衡翻掉了。小鱼与小驴坠入大海,小鱼醒来后发现小驴不见了,慌
2016-06-03 12:32:09 36410
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人