自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(220)
  • 收藏
  • 关注

转载 [2019杭电多校第六场]

1005传送门题意:一个二维图上有若干个点,每个点有一个坐标值(xi,yi),以及一个价值(vi) ( -1e9<=xi,yi,vi<=1e9),求一个价值和最大的矩形(只需输出最大价值和)题解:离散化后枚举上下边界可以将二维图降维为一个求一维动态最大字段和的问题,在横轴上建立线段树即可维护最大字段和#include<bits/stdc++.h>usi...

2019-08-09 15:56:00 176

转载 [2019杭电多校第五场]

1004传送门题意:求\(\sum_{i=1}^n\) \(\mid\)a[i] * x+b[i]\(\mid\)=C(其中1<=ai<=1000,-1000<=b[i]<=1000)的所有解,如果解有无穷个则输出-1题解:由于a[i]>=1,所以\(\mid\)a[i] * x+b[i]\(\mid\)的值在x=-b[i]/a[i]左边时==-a[...

2019-08-07 19:43:00 179

转载 [cf920G][容斥原理+二分]

https://codeforc.es/contest/920/problem/GG. List Of Integerstime limit per test5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output...

2019-05-26 14:48:00 205

转载 [cf920E][set+dfs]

https://codeforc.es/contest/920/problem/EE. Connected Components?time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output...

2019-05-24 08:41:00 192

转载 [线性筛][筛素数/筛约数个数]

线性筛中每个数只会被最小的素因子筛一次1)线性筛素数 1 void getprime(int siz){ 2 memset(isprime,1,sizeof(isprime)); 3 isprime[1]=0; 4 for(int i=2;i<=siz;i++){ 5 if(isprime[i])prime[++t...

2019-05-23 12:52:00 182

转载 [2019南昌邀请赛网络赛D][dp]

https://nanti.jisuanke.com/t/38223Xiao Ming recently indulges in match stick game and he thinks he is good at it. His friend Xiao Jun decides to test him. Xiao Jun gives him an expression of ...

2019-05-20 19:00:00 139

转载 [ Educational Codeforces Round 65 (Rated for Div. 2)][二分]

https://codeforc.es/contest/1167/problem/EE. Range Deletingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard ou...

2019-05-20 12:13:00 80

转载 [hdoj5927][dfs]

http://acm.hdu.edu.cn/showproblem.php?pid=5927Auxiliary SetTime Limit: 9000/4500 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2991Accepted Submission(...

2019-05-16 20:49:00 123

转载 [cf1140D. Minimum Triangulation][dp]

D. Minimum Triangulationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a regular pol...

2019-05-16 09:14:00 153

转载 [hdoj6483][莫队+线段树/ST]

A Sequence GameTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 712Accepted Submission(s): 114Problem DescriptionOne day, WNJXYK f...

2019-05-14 15:31:00 129

转载 [转][二阶常系数线性齐次递推式]

https://www.cnblogs.com/autoint/p/10422212.html问题:f(n)=c1*f(n-1)+c2*f(n-2),c1,c2是常数,已知f(0)和f(1),求f(n)的通项公式结论:先求出上面递推式的特征方程:x^2−c1x−c2=0。设两根分别为x1,x2。若x1≠x2,则f(n)=A∗x1^n+B∗x2^n若x1=x2,则f(n)=(A+B...

2019-05-13 12:18:00 253

转载 [环形染色][公式推导/矩阵快速幂]

环形染色问题:有一个含有n个珠子的环,每个相邻珠子不能被涂上相同的颜色,一共有m种染料,求总方案数。分析:设Fn表示n个珠子的方案数,考虑在n-1个珠子里插入一个珠子,那么得到的方案数应该是(m-2)*Fn-1,再考虑把n-2个珠子其中一个珠子分成两份并且在中间插入一个珠子,则得到的方案数应该是(m-1)*Fn-2,所以Fn=(m-1)*Fn-2+(m-2)*Fn-1求解:当n很...

2019-05-13 11:31:00 2354

转载 [矩阵快速幂专题]

http://acm.hdu.edu.cn/showproblem.php?pid=2604QueuingTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 8168Accepted Submission(s): 3...

2019-05-12 19:53:00 94

转载 [hdoj6415 Rikka with Nash Equilibrium][dp]

http://acm.hdu.edu.cn/showproblem.php?pid=6415Rikka with Nash EquilibriumTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 2021Acc...

2019-05-08 16:35:00 110

转载 [codeforces][dp]

链接:https://ac.nowcoder.com/acm/problem/21314来源:牛客网题目描述牛牛正在打一场CF 比赛时间为T分钟,有N道题,可以在比赛时间内的任意时间提交代码 第i道题的分数为maxPoints[i],题目的分数随着比赛的进行,每分钟减少pointsPerMinute[i] 这是一场比较dark的Cf,分数可能减成负数 已知第i道题...

2019-05-07 16:36:00 189

转载 [2019年湘潭大学程序设计竞赛(重现赛)H chat][背包dp]

链接:https://ac.nowcoder.com/acm/contest/893/H来源:牛客网题目描述在Casya生活的世界里,一天由m个小时组成。 最近Casya的女神终于答应在接下来的n天中与Casya聊天,Casya非常激动。 在这n天中的每一天的每一个小时中女神可能会在线或者不在线, 某个小时如果女神如果在线且Casya在线的话他们就会开心的...

2019-05-04 22:59:00 141

转载 [一道区间dp][String painter]

http://acm.hdu.edu.cn/showproblem.php?pid=2476String painterTime Limit: 5000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6863Accepted Submission...

2019-05-04 15:13:00 88

转载 [hdoj4578][多延迟标记的线段树]

TransformationTime Limit: 15000/8000 MS (Java/Others)Memory Limit: 65535/65536 K (Java/Others)Total Submission(s): 9392Accepted Submission(s): 2408Problem DescriptionYuanfang is puz...

2019-05-03 13:12:00 87

转载 [cf1138BCircus][枚举,列等式]

https://codeforc.es/contest/1138/problem/BB. Circustime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp ...

2019-05-02 16:52:00 114

转载 [Assign the task][dfs序+线段树]

http://acm.hdu.edu.cn/showproblem.php?pid=3974Assign the taskTime Limit: 15000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7144Accepted Submissi...

2019-05-02 14:40:00 87

转载 [codeforces792C][dp]

https://codeforc.es/contest/792/problem/CC. Divide by Threetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard out...

2019-05-02 09:11:00 247

转载 [ Codeforces Round #554 (Div. 2) C]

C. Neko does Mathstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputNeko loves divisors. During the la...

2019-04-25 15:20:00 76

转载 [单调栈专题]

https://vjudge.net/contest/296911#overviewA - SubsequenceThere is a sequence of integers. Your task is to find the longest subsequence that satisfies the following condition: the differe...

2019-04-23 22:11:00 206

转载 [删括号][判断可行性的dp]

链接:https://ac.nowcoder.com/acm/problem/21303来源:牛客网题目描述给你一个合法的括号序列s1,每次你可以删除一个"()" 你可以删除0个或者多个"()" 求能否删成另一个括号序列s2输入描述:第一行输入一个字符串s (2 ≤ |s| ≤ 100)第二行输入一个字符串t (2 ≤ |t| ≤ 100 )输出描述:如果可以输出"P...

2019-04-21 23:31:00 133

转载 [Tom and Bag][需要记录过程的dp]

http://acm.beihua.edu.cn/problem/1007Tom and BagDescriptionTom is the most handsome CCPC contestant in HIT.Tom got a bag recently. The bag has a volume V. Tom has n boxe...

2019-04-21 21:41:00 163

转载 The 19th Zhejiang University Programming Contest Sponsored by TuSimple (Mirror)

http://acm.zju.edu.cn/onlinejudge/showContestProblems.do?contestId=391A Thanks, TuSimple!Time Limit: 1 Second Memory Limit: 65536 KB题意:有t组数据,n个男生,m个女生,每个人身高不同,每个人都期望和比自己高或者比自己...

2019-04-15 12:30:00 84

转载 2050 Programming Competition

http://2050.acmclub.cn/contests/contest_show.php?cid=3开场白Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Problem Description来自世界各地的年青人在 https://2050.org...

2019-04-15 08:45:00 148

转载 [spoj Favorite Dice ][期望dp]

(1)https://vjudge.net/problem/SPOJ-FAVDICE题意:有一个n面的骰子,每一面朝上的概率相同,求所有面都朝上过至少一次的总次数期望。题解:令dp[i]表示 i 面满足条件的期望次数,则有 dp[i]=$\sum_{j=1}^{i-1}$(Pj*(本次操作对最终期望的贡献+dp[i]))+$\sum_{j=1}^{n-(i-1)}$(Qj*(本次...

2019-04-12 09:24:00 132

转载 [小明打联盟][斜率/单调队列 优化dp][背包]

链接:https://ac.nowcoder.com/acm/problem/14553来源:牛客网题目描述 小明很喜欢打游戏,现在已知一个新英雄即将推出,他同样拥有四个技能,其中三个小技能的释放时间和固定的伤害值为: 1.乌鸦坐飞机 释放时间:x 固定伤害值:a 2.蜘蛛吃耳屎 释放时间:y 固定伤害值:b 3.饿狼前进 释放时间...

2019-04-11 12:17:00 124

转载 [树形dp]

链接:https://ac.nowcoder.com/acm/problem/13249来源:牛客网题目描述一棵n个点的有根树,1号点为根,相邻的两个节点之间的距离为1。树上每个节点i对应一个值k[i]。每个点都有一个颜色,初始的时候所有点都是白色的。 你需要通过一系列操作使得最终每个点变成黑色。每次操作需要选择一个节点i,i必须是白色的,然后i到根的链上(包括节...

2019-04-10 13:42:00 170

转载 [cf1025D][区间dp]

http://codeforces.com/contest/1025/problem/DD. Recovering BSTtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output...

2019-04-09 22:41:00 113

转载 [CF1041F Ray in the tube][数学]

http://codeforces.com/contest/1041/problem/F题目大意:下边界有n个给定点,上边界有m个给定点,可以从任意一个点发出一条激光,激光碰到边界会反射激光到达边界必须打到整数点,问最多可以打到几个给定点输入格式:第一行两个整数n,y1​,表示下边界给定点的个数和下边界的纵坐标第二行n个整数,表示给定点的...

2019-04-09 20:55:00 97

转载 [cf1038E][欧拉路]

http://codeforces.com/contest/1038/problem/EE. Maximum Matchingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output...

2019-04-09 16:14:00 106

转载 [最小费用最大流(板子)]

1 typedef long long ll; 2 const ll inf=0x3f3f3f3f; 3 struct edge{ 4 int x; 5 int y; 6 ll v;//流量 7 ll c;//费用 8 int nex; 9 }e[1005];10 ll flow,res;11 int ...

2019-04-08 20:16:00 87

转载 [网络流24题]

https://www.luogu.org/problemnew/show/P4016题目描述GGG 公司有 nnn 个沿铁路运输线环形排列的仓库,每个仓库存储的货物数量不等。如何用最少搬运量可以使 nnn 个仓库的库存数量相同。搬运货物时,只能在相邻的仓库之间搬运。输入输出格式输入格式:文件的第 1 行中有 1 个正整数 n,表示有 n 个仓库。第 2 行中有 ...

2019-04-08 20:11:00 61

转载 [ACM International Collegiate Programming Contest, Amman Collegiate Programming Contest (2018)]

https://codeforces.com/gym/101810A. Careful Thieftime limit per test2.5 smemory limit per test256 MBinputstandard inputoutputstandard outputThere are consecutive...

2019-04-03 20:11:00 352

转载 [Split The Tree][dfs序+树状数组求区间数的种数]

Split The Tree时间限制:1 Sec内存限制:128 MB提交:46解决:11[提交] [状态] [讨论版] [命题人:admin]题目描述You are given a tree with n vertices, numbered from 1 to n. ithvertex has a value wiWe define the weig...

2019-04-01 21:37:00 91

转载 [CSL 的魔法][求排序最少交换次数]

链接:https://ac.nowcoder.com/acm/contest/551/E来源:牛客网题目描述有两个长度为 n 的序列,a0,a1,…,an−1a0,a1,…,an−1和 b0,b1,…,bn−1b0,b1,…,bn−1。CSL 有一种魔法,每执行一次魔法,可以任意挑选一个序列并任意交换序列中两个元素的位置。CSL 使用若干次魔法,得到最终的序列 a 和 b,并且想...

2019-04-01 18:04:00 198

转载 [CSL 的字符串][栈,模拟]

链接:https://ac.nowcoder.com/acm/contest/551/D来源:牛客网题目描述CSL 以前不会字符串算法,经过一年的训练,他还是不会……于是他打算向你求助。 给定一个字符串,只含有可打印字符,通过删除若干字符得到新字符串,新字符串必须满足两个条件: 原字符串中出现的字符,新字符串也必须包含。 新字符串中所有...

2019-03-31 20:51:00 112

转载 [ Codeforces Round #549 (Div. 2)][D. The Beatles][exgcd]

https://codeforces.com/contest/1143/problem/DD. The Beatlestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputR...

2019-03-31 11:36:00 96

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除