自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

红点雷龙XL

Talk is cheap, show me the code.

  • 博客(17)
  • 收藏
  • 关注

原创 暑假假期训练总结-2

早上的讨论:学到不少东西,很细节,很舒服。上午看了看之前没看明白的中国剩余定理,上午看斐波那契数,跟着推导了一下得出结论,卡特兰数,卡特兰数没看完,看了它一些例题下午:做题英语不好就真的很呆,很傻,很难受。之后看了看卡特兰数的一些题型,在问题中基本上要推导问题靠拢到卡特兰数的第一个递推公式上,再用后面的组合公式就很方便了。认为斐波那契数和卡特兰数都属于推导问题靠拢某个已经推导好...

2018-07-31 22:14:55 217

原创 Intense Heat-前缀和暴力求解

【题目】The heat during the last few days has been really intense. Scientists from all over the Berland study how the temperatures and weather change, and they claim that this summer is abnormally hot. ...

2018-07-31 19:28:55 456

原创 暑假假期训练总结-1

一、快速幂快速幂求(a^b)%n。1.递归实现int quickpow(int a,int b,int c){ if(b==1) return a; if(b%2==0) { int t=quickpow(a,b/2,n); return t*t%n; } else { int t=q...

2018-07-30 22:26:13 230

原创 The Cow Prom -Tarjan求强连通分量-模板

题目描述The N (2 <= N <= 10,000) cows are so excited: it's prom night! They are dressed in their finest gowns, complete with corsages and new shoes. They know that tonight they will each try to pe...

2018-07-29 16:12:36 148

原创 Expedition -贪心+优先队列

【题目】A group of cows grabbed a truck and ventured on an expedition deep into the jungle. Being rather poor drivers, the cows unfortunately managed to run over a rock and puncture the truck's fuel tan...

2018-07-28 09:50:30 391 1

原创 P2850-虫洞Wormholes-bellman_ford找负环

题目描述While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a time ...

2018-07-27 16:16:51 188

原创 P2855 ]河跳房子River Hopscotch-最大最小值-二分

题目描述Every year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The excitement takes place on a long, straight river wit...

2018-07-27 11:38:46 222

原创 P2854-牛的过山车Cow Roller Coaster -dfs剪枝

题目描述The cows are building a roller coaster! They want your help to design as fun a roller coaster as possible, while keeping to the budget.The roller coaster will be built on a long linear stretch...

2018-07-27 10:28:58 199

原创 Cow Picnic -dfs

【题目】The cows are having a picnic! Each of Farmer John's K (1 ≤ K ≤ 100) cows is grazing in one of N (1 ≤ N ≤ 1,000) pastures, conveniently numbered 1...N. The pastures are connected by M (1 ≤ M ≤ 10...

2018-07-26 19:59:28 225

原创 Stall Reservations -贪心+优先队列-区间问题

【题目】Oh those picky N (1 <= N <= 50,000) cows! They are so picky that each one will only be milked over some precise time interval A..B (1 <= A <= B <= 1,000,000), which includes both ...

2018-07-26 18:13:50 271

原创 Backward Digit Sums -全排列找解

【题目】FJ and his cows enjoy playing a mental game. They write down the numbers from 1 to N (1 <= N <= 10) in a certain order and then sum adjacent numbers to produce a new list with one fewer nu...

2018-07-26 14:56:13 126

原创 Treats for the Cows -dp

【题目】FJ has purchased N (1 <= N <= 2000) yummy treats for the cows who get money for giving vast amounts of milk. FJ sells one treat per day and wants to maximize the money he receives over a g...

2018-07-26 13:43:10 175

原创 Dollar Dayz-完全背包+大数处理

【题目】Farmer John goes to Dollar Days at The Cow Store and discovers an unlimited number of tools on sale. During his first visit, the tools are selling variously for $1, $2, and $3. Farmer John has e...

2018-07-26 11:38:02 1422

原创 Roadblocks-次最短路,Dijkstra变形+邻接表存储

题目:    Bessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to get to her old home too quickly, because she likes the scenery along the w...

2018-07-15 15:28:58 305

原创 Fence Repair-贪心优先队列

题目:    Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000) planks of wood, each having some integer length Li (...

2018-07-15 13:03:44 240

原创 1219:马走日

题目:        马在中国象棋以日字形规则移动。请编写一段程序,给定n×m大小的棋盘,以及马的初始位置(x,y),要求不能重复经过棋盘上的同一个点,计算马可以有多少途径遍历棋盘上的所有点。输入:      第一行为整数T(T < 10),表示测试数据组数。每一组测试数据包含一行,为四个整数,分别为棋盘的大小以及初始位置坐标n,m,x,y。(0≤x≤n-1,0≤y≤m-1, m < ...

2018-07-04 16:55:00 1336

原创 DFS--深度优先搜索

【基本思想】    为了求得问题的解,先选择一种可能的情况先前搜索,一旦发现之前的选择是错误的,就退一步重新选择,继续向前探索,如此反复进行,知道得到问题的解或无解。【算法原理】    从初始状态,利用规则生成搜索树下一层任一个结点,检查是否出现目标状态,若未出现,以此状态利用规则生成再下一层任一个结点,再检查,重复过程一直到叶节点(即不能再生成新状态节点),当它仍不是目标状态时,回溯到上一层结果...

2018-07-04 16:34:19 114

空空如也

空空如也

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

TA关注的人

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