自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 HDU 3586 Information Disturbing(树形dp+二分)

Information DisturbingTime Limit: 6000/3000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 4017    Accepted Submission(s): 1399Problem DescriptionIn the battlefield...

2018-05-31 23:07:07 144

原创 POJ 2486 Apple Tree

Apple TreeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 11728 Accepted: 3966DescriptionWshxzt is a lovely girl. She likes apple very much. One day HX takes her to an apple tree. There are ...

2018-05-30 11:10:18 150

原创 20132014-acmicpc-brazil-subregional-programming-contest Problem J Trucks

题解:把没用的边删掉,剩下一棵最大生成树,倍增求公共祖先即可。代码:#include<bits/stdc++.h>using namespace std;const int maxn=2e4+7;struct node{ int from,to,cost;}c[5*maxn];vector<node>G[maxn];bool vis[5*max...

2018-05-30 10:22:01 300

原创 20132014-acmicpc-brazil-subregional-programming-contest Problem H Buses (dp+矩阵快速幂)

题解:每增加5米,可以在这个位置方一辆5米的车,或者在这个位置和之前位置放一个10米的车dp[i]=K*dp[i-1]+L*dp[i-2]代码:#include<bits/stdc++.h>using namespace std;#define ll long longconst int mod=1e6;ll n,K,L;struct node{ ll t...

2018-05-30 10:17:00 330

原创 HDU 4276 The Ghost Blows Light(树形dp)

The Ghost Blows LightTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3844    Accepted Submission(s): 1256Problem DescriptionMy name is Hu Bayi, ...

2018-05-28 23:30:03 158

原创 ZOJ 3626 Treasure Hunt I (树形dp)

Treasure Hunt ITime Limit: 2 Seconds      Memory Limit: 65536 KBAkiba is a dangerous country since a bloodsucker living there. Sometimes the bloodsucker will appear and kill everyone who isn't at his ...

2018-05-28 12:57:41 197

原创 Wannafly挑战赛16 B-AB序列(三分查找)

链接:https://www.nowcoder.com/acm/contest/113/B来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld题目描述给长度为n的序列A,长度为m的序列B。可以给A序列里每个元素加上x且B序列里每个元素减去x (x可以是负数),问的最小值输入描述:第一行两个整数分...

2018-05-26 23:02:43 344

原创 Wannafly挑战赛16 A-取石子(组合数学)

链接:https://www.nowcoder.com/acm/contest/113/A来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld题目描述给出四堆石子,石子数分别为a,b,c,d。规定每次只能从堆顶取走石子,问取走所有石子的方案数。输入描述:在一行内读入四个由空格分隔的整数a,b,c...

2018-05-26 22:06:27 353

原创 POJ 1947 Rebuilding Roads(树形dp)

Rebuilding RoadsTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 12650 Accepted: 5882DescriptionThe cows have reconstructed Farmer John's farm, with its N barns (1 <= N <= 150, number 1...

2018-05-23 19:39:28 148

原创 HDU 1011 Starship Troopers

Starship TroopersTime Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 22100    Accepted Submission(s): 5852Problem DescriptionYou, the leader of Sta...

2018-05-23 16:49:53 150

原创 POJ 1155 TELE(树上的背包)

TELETime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 5739 Accepted: 3180DescriptionA TV-network plans to broadcast an important football match. Their network of transmitters and users can be ...

2018-05-22 20:09:19 128

原创 HDU 6029 Graph Theory

Graph TheoryTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1796    Accepted Submission(s): 750Problem DescriptionLittle Q loves playing with ...

2018-05-22 18:23:46 135

原创 Codeforces Round #135 (Div. 2) D. Choosing Capital for Treeland(树形dp)

D. Choosing Capital for Treelandtime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe country Treeland consists of n cities, some pairs of them are ...

2018-05-22 15:22:59 180

原创 Codeforces Round #482 (Div. 2)D. Kuro and GCD and XOR and SUM

D. Kuro and GCD and XOR and SUMtime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputKuro is currently playing an educational game about numbers. The ga...

2018-05-22 10:19:27 216

原创 HDU 4825 Xor Sum(01字典树)

Xor SumTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 132768/132768 K (Java/Others)Total Submission(s): 4132    Accepted Submission(s): 1803Problem DescriptionZeus 和 Prometheus 做了一个游戏,Prometh...

2018-05-22 09:34:09 110

原创 POJ 1741 Tree(树上点分治)

TreeTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 28073 Accepted: 9355DescriptionGive a tree with n vertices,each edge has a length(positive integer less than 1001). Define dist(u,v)=The m...

2018-05-21 17:48:38 190

原创 POJ 1655 Balancing Act(找树的重心)

Balancing ActTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 15739 Accepted: 6670DescriptionConsider a tree T with N (1 <= N <= 20,000) nodes numbered 1...N. Deleting any node from the...

2018-05-20 15:52:46 130

原创 HDU 2196 Computer

ComputerTime Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 32564    Accepted Submission(s): 4595Problem DescriptionA school bought the first comput...

2018-05-20 13:58:11 128

原创 树形dp题目汇总

一、常规树形DP     1、 Hdu 1520 Anniversary party  每个节点有权值,子节点和父节点不能同时选,问最后能选的最大价值是多少?解题报告Here      2、Hdu 2196 Computer  经典题,求树每个点到其他点的最远距离,转化为有根树,深搜两次,一次记录到叶子的最远距离,一次更新最终答案。解题报告Here      3、Poj 1741 Tree(难) ...

2018-05-19 23:46:30 643

原创 POJ 2342 Anniversary party(树形dp)

Anniversary partyTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10545 Accepted: 6033DescriptionThere is going to be a party to celebrate the 80-th Anniversary of the Ural State University. ...

2018-05-19 23:28:42 233

原创 zufe 2485 Sequence

问题 W: Sequence时间限制: 2 Sec  内存限制: 128 MB提交: 4  解决: 3[提交][状态][讨论版]题目描述有一个序列,n个非负整数,a1,a2,a3,a4......,an有Q次操作,操作分两种:1 p x:将a[p]改为x2 L R:查询区间[L,R]中 大于等于pow(17,last%5) 的数字有几个,last是上一次询问的答案,一开始设last为0。输入第一行...

2018-05-19 21:06:25 118

原创 zufe 2475 kiminonamaewa

题目描述输入输出样例输入14abab样例输出8#include<bits/stdc++.h>using namespace std;const int mod=1e9+7;int dp[55][55];char t[55];int main(){ int T;scanf("%d",&T); while(T--) { mem...

2018-05-19 21:02:52 349

原创 zufe 2432 圆覆盖

问题 K: 圆覆盖时间限制: 1 Sec  内存限制: 256 MB提交: 64  解决: 12[提交][状态][讨论版]题目描述题解:找一个圆,枚举圆中的纵坐标,对于每个圆循环一次求区间的并。代码:#include<bits/stdc++.h>using namespace std;#define ll long longll x[102],y[102],r[102];...

2018-05-19 20:59:16 137

原创 POJ 2836 Rectangular Covering

Rectangular CoveringTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2813 Accepted: 800Descriptionn points are given on the Cartesian plane. Now you have to use some rectangles whose sides ar...

2018-05-16 16:01:48 172

原创 POJ 3254 Corn Fields

Time Limit: 2000MS Memory Limit: 65536KTotal Submissions: 18759 Accepted: 9868DescriptionFarmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square par...

2018-05-16 14:29:51 95

原创 POJ 2441 Arrange the Bulls(状压dp)

Arrange the BullsTime Limit: 4000MS Memory Limit: 65536KTotal Submissions: 5471 Accepted: 2088DescriptionFarmer Johnson's Bulls love playing basketball very much. But none of them would like to play b...

2018-05-14 23:01:25 95

原创 HDU 5710 Digit-Sum

Digit-SumTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 784    Accepted Submission(s): 242Problem DescriptionLet S(N) be digit-sum of N, i.e S(...

2018-05-14 19:58:14 301 1

原创 Wannafly挑战赛15 E-小W的斜率

链接:https://www.nowcoder.com/acm/contest/112/E来源:牛客网题目描述小W非常喜欢某个有理数P/Q,而且他非常喜欢用它来进行一些玄学操作。他在二维平面上撒下了n个点,这些点相互不同,但一番观察之后,他失望的发现并没有任何两个点连成的直线的斜率是P/Q。你能不能告诉他在这些斜率中最接近P/Q的是多少。输入描述:第一行包括三个正整数n,P,Q(5<=n&l...

2018-05-12 16:13:48 215

原创 Wannafly挑战赛15 D-数字串(线段树)

链接:https://www.nowcoder.com/acm/contest/112/D来源:牛客网题目描述 一个只含数字的字符串,q次操作,每次操作将第i位数字改为x,每次操作后,统计长度在[l, r]之间且首数字大于尾数字的子串的个数。 输入描述:第一行一个只含数字的字符串;第二行3个整数q, l, r;接下来q行,每行两个整数i, x。输出描述:输出q行,每行一个整数,表示长度在[l...

2018-05-12 12:27:14 226

原创 Wannafly挑战赛15 A-最小化价格(贪心)

链接:https://www.nowcoder.com/acm/contest/112/A来源:牛客网题目描述现有n组人,m个地点,给出每组人的人数,每个地点可容纳的最大人数和选择的价格 要求一种方式,使得每组人都到一个各不相同的地点,最小化选择的价格 每个队伍的人都要在同一个地方每个地方只能有一个队伍输入描述:第一行n,m第二行n个数,表示每组的人数接下来m行,每行两个数,表示可容纳...

2018-05-12 10:52:23 251

原创 HDU 2295 Radar(舞蹈链+二分)

RadarTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4292    Accepted Submission(s): 1657Problem DescriptionN cities of the Java Kingdom need to...

2018-05-11 18:51:55 222

原创 HDU 3599 War(最短路+最大流)

WarTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1746    Accepted Submission(s): 414Problem DescriptionIn the war between Anihc and Bandzi, An...

2018-05-11 15:12:51 248

原创 Tinkoff Internship Warmup Round 2018 and Codeforces Round #475 (Div. 2) D. Destruction of a Tree

D. Destruction of a Treetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a tree (a graph with n vertices and n - 1 edges in which it's...

2018-05-11 13:08:14 241

原创 Tinkoff Internship Warmup Round 2018 and Codeforces Round #475 (Div. 2)C. Alternati(费马小定理求逆元+等比数列求和)

C. Alternating Sumtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two integers aa and bb. Moreover, you are given a sequence s0,s1,…,...

2018-05-11 13:02:08 373

原创 第十四届华中科技大学程序设计竞赛决赛同步赛 A-Beauty of Trees(并查集)

链接:https://www.nowcoder.com/acm/contest/119/A来源:牛客网题目描述It’s universally acknowledged that there’re innumerable trees in the campus of HUST. One day the tree manager wants to play a game with you. Ther...

2018-05-09 18:37:44 203

原创 第十四届华中科技大学程序设计竞赛决赛同步赛 F-Beautiful Land(超大背包)

链接:https://www.nowcoder.com/acm/contest/119/F来源:牛客网题目描述It’s universally acknowledged that there’re innumerable trees in the campus of HUST. Now HUST got a big land whose capacity is C to plant trees. ...

2018-05-09 16:27:28 157

原创 ZOJ 3209 Treasure Map(舞蹈链)

Treasure MapTime Limit: 2 Seconds      Memory Limit: 32768 KBYour boss once had got many copies of a treasure map. Unfortunately, all the copies are now broken to many rectangular pieces, and what mak...

2018-05-09 15:44:30 184

原创 FZU Problem 1686 神龙的难题(舞蹈链)

Problem 1686 神龙的难题Accept: 860    Submit: 2548Time Limit: 1000 mSec    Memory Limit : 32768 KB Problem Description这是个剑与魔法的世界.英雄和魔物同在,动荡和安定并存.但总的来说,库尔特王国是个安宁的国家,人民安居乐业,魔物也比较少.但是.总有一些魔物不时会进入城市附近,干扰人民的生活....

2018-05-09 14:11:51 284

原创 “今日头条杯”首届湖北省大学程序设计竞赛(网络同步赛)F. Flower Road(十字链表)

链接:https://www.nowcoder.com/acm/contest/104/E来源:牛客网题目描述 (受限于评测机,此题数据范围与现场赛不一致,请谅解) Once upon a time, there was a beautiful princess named TQM, and a handsome prince named GSS. One day, the pri...

2018-05-08 21:24:39 292 2

原创 第十四届华中科技大学程序设计竞赛决赛同步赛(舞蹈链+A*搜索)

链接:https://www.nowcoder.com/acm/contest/119/J来源:牛客网题目描述It’s universally acknowledged that there’re innumerable trees in the campus of HUST. There is an N×M grid, some are black and some are white. You...

2018-05-08 10:54:01 270

空空如也

空空如也

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

TA关注的人

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