自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 UVA - 624 (01背包)

You have a long drive by car ahead. You have a tape recorder, but unfortunately your best music is onCDs. You need to have it on tapes so the problem to solve is: you have a tape N minutes long. Howto...

2018-03-31 20:21:08 309

原创 CodeForces - 586D Phillip and Trains(bfs)

The mobile application store has a new game called "Subway Roller".The protagonist of the game Philip is located in one end of the tunnel and wants to get out of the other one. The tunnel is a rectang...

2018-03-28 20:24:36 140

原创 CodeForces - 754D Fedor and coupons (优先队列)

All our characters have hobbies. The same is true for Fedor. He enjoys shopping in the neighboring supermarket.The goods in the supermarket have unique integer ids. Also, for every integer there is a ...

2018-03-28 19:03:15 184

原创 FZU - 2209 老S的旅行计划(最短路spfa)

老S在某城市生活的非常不自在,想趁着ICPC举办期间在省内转转。已知老S所在的省有N个城市,M条无向边(对于某一对结点可能出现重边)。由于省内的交通相当糟糕,通过某条边所需要花费的时间受到一天中不同时刻的影响。此外对于某一时刻(一天24小时的任意一个整点算一个时刻),从任何方向通过无向边所需要的时间相同。现在老S想请你帮他规划一下旅行路线。Input第一行输入为一个整数T表示测试个数T对于每一个测...

2018-03-28 11:08:03 106

原创 HDU - 4528 小明系列故事——捉迷藏 (广搜)

小明的妈妈生了三个孩子,老大叫大明, 老二叫二明, 老三..., 老三自然就叫小明了。  一天,小明的妈妈带小明兄弟三人去公园玩耍,公园里面树木很多,有很多地方可以藏身, 于是他们决定玩捉迷藏。经过几轮的猜拳后,第一轮是小明来找其他两个人,游戏规则很简单:  只要小明可以在规定的时间内找到他们就算小明获胜,并且被发现的两个人猜拳决定谁在下一轮负责找人;如果在规定的时间内只找到一个人,那么没有被发现...

2018-03-27 16:50:18 153

原创 第13届景驰-埃森哲杯广东工业大学ACM程序设计大赛 D (最长公共子序列)

链接:https://www.nowcoder.com/acm/contest/90/D来源:牛客网题目描述 掌握未来命运的女神 psd 师兄在拿了朝田诗乃的 buff 后决定去实习。 埃森哲公司注册成立于爱尔兰,是一家全球领先的专业服务公司,为客户提供战略、咨询、数字、技术和运营服务及解决方案。他们立足商业与技术的前沿,业务涵盖40多个行业,以及企业日常运营部门的各个职能。凭借独特的业内...

2018-03-26 18:58:50 132

原创 第13届景驰-埃森哲杯广东工业大学ACM程序设计大赛 F 等式(求因子个数)

链接:https://www.nowcoder.com/acm/contest/90/F来源:牛客网题目描述 给定n,求1/x + 1/y = 1/n (x<=y)的解数。(x、y、n均为正整数)输入描述:在第一行输入一个正整数T。接下来有T行,每行输入一个正整数n,请求出符合该方程要求的解数。(1<=n<=1e9)输出描述:输出符合该方程要求的解数。输入3120180...

2018-03-26 15:15:25 227

转载 素数筛法

原博客:http://blog.csdn.net/once_hnu/article/details/6302283  素数是ACM中数论题目常常涉及到得问题。最基本的问题就是如何判断一个数是素数以及如何快速的打出题目涉及范围的素数表。当然数论中关于素数的问题会比较复杂,在这里仅就素数的不同筛法做出总结。      素数,就是只有1和自身两个约数的正整数。2是最小的素数。根据定义,我们就可以直接判断...

2018-03-22 10:27:18 113

转载 欧拉函数

------------------------------------------------------原博客 ----------------------------------------------------------  对正整数n,欧拉函数是少于或等于n的数中与n互质的数的数目。例如euler(8)=4,因为1,3,5,7均和8互质。     Euler函数表达通式:euler(x...

2018-03-22 10:25:41 108

原创 hdu 2841 Visible Trees (容斥原理)

There are many trees forming a m * n grid, the grid starts from (1,1). Farmer Sherlock is standing at (0,0) point. He wonders how many trees he can see. If two trees and Sherlock are in one line, Farm...

2018-03-21 18:35:42 194

原创 hdu 4135 Co-prime(容斥原理)

Given a number N, you are asked to count the number of integers between A and B inclusive which are relatively prime to N. Two integers are said to be co-prime or relatively prime if they have no comm...

2018-03-21 14:18:52 120

原创 poj 3370 Halloween treats

Every year there is the same problem at Halloween: Each neighbour is only willing to give a certain total number of sweets on that day, no matter how many children call on him, so it may happen that a...

2018-03-18 19:32:58 137

原创 POJ 2356 Find a multiple (在n个数组成的数列中找出若干个连续数使它们之和能被n整除)

The input contains N natural (i.e. positive integer) numbers ( N <= 10000 ). Each of that numbers is not greater than 15000. This numbers are not necessarily different (so it may happen that two or...

2018-03-18 19:09:16 812

原创 HDU - 2196 Computer (树形dp详解)

A school bought the first computer some time ago(so this computer's id is 1). During the recent years the school bought N-1 new computers. Each new computer was connected to one of settled earlier. Ma...

2018-03-16 14:20:41 289

原创 poj 2342 Anniversary party (树形dp)

There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees. It means that the supervisor relation forms a tr...

2018-03-16 11:01:14 109

原创 poj1986 Distance Queries (lca模板)

Farmer John's cows refused to run in his marathon since he chose a path much too long for their leisurely lifestyle. He therefore wants to find a path of a more reasonable length. The input to this pr...

2018-03-15 20:06:12 184

原创 POJ1470/ZOJ1141 Closest Common Ancestors(LCA离线算法)

Write a program that takes as input a rooted tree and a list of pairs of vertices. For each pair (u,v) the program determines the closest common ancestor of u and v in the tree. The closest common anc...

2018-03-15 13:30:17 120

原创 POJ 1523 SPF 求割点及对应的连通分量数

Consider the two networks shown below. Assuming that data moves around these networks only between directly connected nodes on a peer-to-peer basis, a failure of a single node, 3, in the network on th...

2018-03-14 19:12:26 232

原创 poj3177Redundant Paths(双连通分量)

In order to get from one of the F (1 <= F <= 5,000) grazing fields (which are numbered 1..F) to another field, Bessie and the rest of the herd are forced to cross near the Tree of Rotten Apples....

2018-03-08 12:25:36 161

原创 UVA 796 - Critical Links (求桥)

In a computer network a link L, which interconnects two servers, is considered critical if there are atleast two servers A and B such that all network interconnection paths between A and B pass throug...

2018-03-07 20:05:27 207

原创 poj1144-Network(求割点)

A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connectingseveral places numbered by integers from 1 to N. No two places have the same number. The linesare bidir...

2018-03-07 13:32:49 162

原创 poj 1236 Network of Schools(连通图缩点)

A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it distributes software (the “receiving sc...

2018-03-06 20:40:37 171

空空如也

空空如也

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

TA关注的人

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