- 博客(60)
- 收藏
- 关注
原创 电子科技大学第九届ACM趣味程序设计竞赛第二场(正式赛) 题解
A::魔王的直播注意23:59之后是00:00即可,找出所有回文字符,取最近.#include using namespace std;bool check(int a,int b){ int c=a%10*10+a/10; if(c==b) return false; return true;}int main(){
2017-12-05 23:27:33 1744
原创 HDU-2665 Kth number
Kth numberTime Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 12578 Accepted Submission(s): 3831Problem DescriptionGive you a se
2017-09-11 13:42:49 404
原创 HDU3572——Task Schedule (最大流判断满流)
Task ScheduleTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9445 Accepted Submission(s): 2911Problem DescriptionOur geometry
2017-08-21 23:40:15 468
原创 POJ1273——Drainage Ditches(最大流模板题)
用来测试模板的模板题题目中已经把图建好了,只需要用最大流模板计算一下就可以了题意:有m个池塘,编号为1-m,1为源点,m为汇点,以及n条水渠,给出1-m的最大流量对此我不得不吐槽一下刘汝佳书上的版实在是太慢了。。。。。。Drainage DitchesTime Limit: 1000MS Memory Limit: 10000KTot
2017-08-21 23:21:37 429
原创 POJ 3744-Scout YYF I (概率DP+矩阵快速幂)
Scout YYF ITime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8894 Accepted: 2607DescriptionYYF is a couragous scout. Now he is on a dangerous mission whic
2017-07-24 01:05:18 415
原创 计蒜之道2017F-腾讯消消乐(状压dp)
腾讯推出了一款益智类游戏——消消乐。游戏一开始,给定一个长度为 nn 的序列,其中第 ii 个数为 A_iAi。游戏的目标是把这些数全都删去,每次删除的操作为:选取一段连续的区间,不妨记为 [L,R][L,R],如果这一段区间内所有数的最大公约数 \geq k≥k(kk值在游戏的一开始会给定),那么这一段区间就能被直接删去。注意:一次删除以后,剩下的数会合并成为一个连续区间。
2017-07-24 00:04:55 410
原创 Gym-101174B Bribing Eve (象限极角排序)
Bribing EveEve works at a magazine that does product reviews and publishesrecommendations to consumers. They are working on anew mobile phones review and have decided on two reproducibletests
2017-07-23 23:54:04 861
原创 Petrozavodsk Summer Training Camp 2016 I-Vier(鸽笼原理)
Problem I. VierInput file: vier.inOutput file: vier.outTime limit: 2 secondsMemory limit: 256 mebibytesThe online game you’ve built in problem “Oha” involves n types of monsters. The monster
2017-07-23 23:46:21 548
原创 Gym - 100781F Floppy Music(bitset+可行初始点)
Gym - 100781F Floppy Music(bitset+可行初始点)
2017-07-23 23:38:05 705
原创 Codeforces 822 D. My pretty girl Noora(多项式加法+dp)
D. My pretty girl Nooratime limit per test1.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn Pavlopolis University where No
2017-07-06 17:28:59 434
原创 Codeforces 822C - Hacker, pack your bags!(二分)
C. Hacker, pack your bags!time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIt's well known that the best wa
2017-07-06 17:11:52 675
原创 CDOJ1323柱爷的下凡
C - 柱爷的下凡Time Limit: 400/400MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)Submit Status下凡的柱爷想只创造3种硬币,要求这3种硬币可以组成[1,N][1,N]的所有整数,并且表示一个[1,N][1,N]中的整数所用硬币的平均数
2017-06-23 22:03:22 656
原创 测试
#include #include #include #define MAX_N 100005#define INF 1008611using namespace std;struct edge { int to, cost; edge (int tt, int cc) : to(tt), cost(cc) {} edge () {}};vector G
2017-06-05 10:57:07 296
原创 ZOJ 3962 E - Seven Segment Display (数位DP)(2017浙江省赛E)
Seven Segment DisplayTime Limit: 2 Seconds Memory Limit: 65536 KBA seven segment display, or seven segment indicator, is a form of electronic display device for displaying decimal numeral
2017-04-26 16:52:03 662
原创 zoj3951 Independent Set(树形dp,空间优化)
Independent SetTime Limit: 1 Second Memory Limit: 65536 KB Special JudgeChiaki has a positive integer m and she would like to construct a tree with at most 15 vertices in such a ma
2017-04-24 20:48:50 828
原创 zoj3956 Course Selection System (背包)
Course Selection SystemTime Limit: 1 Second Memory Limit: 65536 KBThere are n courses in the course selection system of Marjar University. The i-th course is described by two values: ha
2017-04-24 12:06:12 394
原创 codeforce round#410 C(套路)
C. Mike and gcd problemtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMike has a sequence A = [a1, a2, ..
2017-04-22 21:13:08 658
原创 codeforce round#410 D. Mike and distribution(谐星排序选择)
题目:D. Mike and distributiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMike has always
2017-04-22 21:05:36 443
原创 HDU 5134 Highways (圆与多边形面积交)
HighwayTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 285 Accepted Submission(s): 100Special JudgeProblem DescriptionYou j
2017-04-19 18:36:18 735
原创 POJ 1061青蛙的约会(扩展欧几里得)
青蛙的约会Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 113174 Accepted: 23074Description两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直
2017-04-05 00:30:22 353
原创 poj 3734 Blocks(矩阵快速幂)
BlocksTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6472 Accepted: 3117DescriptionPanda has received an assignment of painting a line of blocks. Sin
2017-03-13 19:23:07 424
转载 收藏一下题目分类
初期:一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. (5)构造法.(poj3295) (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996)二.图算法:
2017-03-13 13:20:54 406
原创 CDOJ 1341 卿学姐与城堡的墙(并归排序求逆序对数)
E - 卿学姐与城堡的墙Time Limit: 2000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)Submit Status卿学姐终于来到了魔王的城堡,城堡修建的十分壮观。即使心中放不下公主,卿学姐还是忍不住驻足观赏这宏伟的建筑。卿学姐注意到城
2017-03-13 00:27:06 388
原创 CDOJ 1329 卿学姐与魔法(优先队列)
卿学姐与魔法Time Limit: 1200/800MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)Submit Status“你的膜法也救不了你”——蛤在去拯救公主的道路上,卿学姐披荆斩棘,刀刃早已锈迹斑斑。一日卿学姐正在为武器的问题发愁,碰到了正在赏树的天行廖。
2017-03-13 00:19:56 526
原创 CDOJ 1328 卿学姐与诡异村庄(并查集判断矛盾)
卿学姐与诡异村庄Time Limit: 4500/1500MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)Submit Status日复一日,年复一年,春去秋来。卿学姐终于从天行廖那里毕业啦。出山的卿学姐首先来到了一个诡异的村庄。在这个村庄中,只有两种人,一种是好人,
2017-03-12 23:55:58 787
原创 CDOJ 1325 卿学姐与基本法(离散化+线段树)
题解:看题目想到线段树,但是因为数据范围太大,显然不能直接使用线段树,所以这里应该加上离散化操作代码如下:#include #include using namespace std;const int maxn=100005;int c[2*maxn],kind[maxn],tree[8*maxn],lazy[8*maxn];int cl[maxn],cr[maxn];map
2017-03-12 23:50:59 647
原创 CDOJ 1355 柱爷与三叉戟不得不说的故事(枚举子集状压dp)
柱爷与三叉戟不得不说的故事Time Limit: 500/500MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)Submit Status在喵蛤蛤城,人人都知晓柱爷有一把传奇武器三叉戟.据传,这是一位在772002772002年前陨落的强大守护者F91曾经使用过的12级灵能武
2017-03-11 14:30:40 666
原创 CDOJ 1321柱爷的恋爱 (区间dp)
柱爷的恋爱Time Limit: 1000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)Submit Status她手里有刚刚收到从远方的括号序列(仅包含( ) [ ]的序列),然而序列已经是一团乱麻,不堪入目,柱爷看到她坐在位子掩面哭泣,便上前安慰一番,她向
2017-03-11 12:33:27 599
原创 CDOJ1323柱爷的下凡(暴力枚举+背包)
柱爷的下凡Time Limit: 400/400MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)Submit Status下凡的柱爷想只创造3种硬币,要求这3种硬币可以组成[1,N][1,N]的所有整数,并且表示一个[1,N][1,N]中的整数所用硬币的平均数量最少.你能
2017-03-10 20:12:02 312
原创 CDOJ 1357 柱爷与最大区间和(dp+滚动数组)
题解,这是一个求两个不相邻子区间最大和的问题,我们很容易想到1个区间最大和怎么求,dp[i]=max(dp[i-1],0)+v[i],而这是两个区间,而且是不相邻的,可以得到以下dp公式dp[i][j]=max(dp[i-1][j-2],dp[i][j-1])+v[j].根据数据范围,开一个二维数组肯定是会MLE的,因此应该用两个一维数组滚动存储代码如下:#include #incl
2017-03-10 16:37:45 450
原创 CDOJ 1348柱爷与咸鱼神功(裸01背包)
柱爷与咸鱼神功Time Limit: 1000/1000MS (Java/Others) Memory Limit: 120000/120000KB (Java/Others)Submit Status某日,喵哈哈村,柱爷在自己房间内,面对魔镜"魔镜啊,魔镜,什么才是这个世界上最强大的武功?"霎时,一道惊雷落下,柱爷的面前竟然浮现出了
2017-03-10 13:20:09 478
原创 openj 2945 拦截导弹(裸裸裸LIS)
2945:拦截导弹查看提交统计提示提问总时间限制: 1000ms 内存限制: 65536kB描述某国为了防御敌国的导弹袭击,开发出一种导弹拦截系统。但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能高于前一发的高度。某天,雷达捕捉到敌国的导弹来袭,并观测到导弹依次飞来的高度,请计算这套系统最多能拦截多少
2017-03-09 18:16:41 412
原创 hdu1025Constructing Roads In JGShining's Kingdom(LIS最大上升子序列)
Constructing Roads In JGShining's KingdomTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 24704 Accepted Submission(s): 7038Proble
2017-03-08 18:32:02 364
原创 HDU 1024 MaxSumPlusPlus(进阶一维dp)
Max Sum Plus PlusTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 27506 Accepted Submission(s): 9586Problem DescriptionNow I t
2017-03-06 14:08:36 363
原创 HDU 1003 Max Sum (经典dp入门题)
Max SumTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 235898 Accepted Submission(s): 55672Problem DescriptionGiven a sequenc
2017-03-06 13:21:25 363
原创 codeforces 781A Round #403 Div. 2C
A. Andryusha and Colored Balloonstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAndryusha goes through a
2017-03-06 01:05:51 477
原创 codeforces 782B Round #403 Div. 2B
B. The Meeting Place Cannot Be Changedtime limit per test5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe main road in Byt
2017-03-06 01:00:36 325
原创 CDOJ 1347柱爷的矩阵(二维dp)
柱爷的矩阵Time Limit: 125/125MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)Submit Status柱爷能干这么多大事,与他喜爱玩弄矩阵是分不开的。有一天柱爷创造了一个NN行MM列的的矩阵A,因为一个个造数据太麻烦,所以柱爷只搞了第一列的数据Ai,1,1
2017-03-05 17:34:58 445
原创 poj 2155 Matrix (二维树状数组)
MatrixTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 26353 Accepted: 9729DescriptionGiven an N*N matrix A, whose elements are either 0 or 1. A[i, j] me
2017-03-05 13:55:40 347
原创 HUD1556 (树状数组解法+线段树解法)
Color the ballTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 18680 Accepted Submission(s): 9319Problem DescriptionN个气球排成一排,从
2017-03-04 18:07:25 383
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人