- 博客(19)
- 收藏
- 关注
原创 Proving Equivalences HDU - 2767(强连通)
Consider the following exercise, found in a generic linear algebra textbook. Let A be an n × n matrix. Prove that the following statements are equivalent: A is invertible. Ax = b has exactly one solu
2017-07-31 18:22:22 369
原创 迷宫城堡 HDU - 1269 (强连通)
为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个房间(N<=10000)和M条通道(M<=100000),每个通道都是单向的,就是说若称某通道连通了A房间和B房间,只说明可以通过这个通道由A房间到达B房间,但并不说明通过它可以由B房间到达A房间。Gardon需要请你写个程序确认一下是否任意两个房间都是相互连通的,即:对于任意的i和j,至少存在一条路径可以从房间i到房间j,也存在一条路径
2017-07-31 14:24:49 299
原创 More Divisors ZOJ - 2562 (反素数)
Everybody knows that we use decimal notation, i.e. the base of our notation is 10. Historians say that it is so because men have ten fingers. Maybe they are right. However, this is often not very conve
2017-07-29 14:03:37 388
原创 Cow Sorting POJ - 3270 (置换)
Farmer John’s N (1 ≤ N ≤ 10,000) cows are lined up to be milked in the evening. Each cow has a unique “grumpiness” level in the range 1…100,000. Since grumpy cows are more likely to damage FJ’s milking
2017-07-28 20:32:39 341
原创 How far away ? HDU - 2586 (LCA)
There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this “How far is it if I want to go from house A to house B”? Usually it hard to
2017-07-26 19:00:39 275
原创 Binary Apple Tree URAL - 1018 (树形dp)
Let’s imagine how apple tree looks in binary computer world. You’re right, it looks just like a binary tree, i.e. any biparous branch splits up to exactly two new branches. We will enumerate by integer
2017-07-26 14:50:17 311
原创 How Many Answers Are Wrong HDU - 3038(种类并查集)
TT and FF are … friends. Uh… very very good friends -__-b FF is a bad boy, he is always wooing TT to play the following game with him. This is a very humdrum game. To begin with, TT should write down a
2017-07-23 19:38:12 370
原创 食物链 POJ - 1182(种类并查集)
动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是”1 X Y”,表示X和Y是同类。 第二种说法是”2 X Y”,表示X吃Y。 此人对N个动物,用上述两种说法,一句接一句地说出
2017-07-23 19:35:35 295
原创 Genghis Khan the Conqueror HDU - 4126(MST)
Genghis Khan(成吉思汗)(1162-1227), also known by his birth name Temujin(铁木真) and temple name Taizu(元太祖), was the founder of the Mongol Empire and the greatest conqueror in Chinese history. After uniting ma
2017-07-22 11:48:11 400
原创 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 com
2017-07-19 14:44:36 413
原创 GCD HUD 1695(容斥原理)
Given 5 integers: a, b, c, d, k, you’re to find x in a…b, y in c…d that GCD(x, y) = k. GCD(x, y) means the greatest common divisor of x and y. Since the number of choices may be very large, you’re only
2017-07-18 23:18:09 383
原创 Mondriaan's Dream POJ - 2411(插头做法带更新)
Squares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after producing the drawings in his ‘toilet series’ (where he had to use his toilet paper to draw on, for all of hi
2017-07-17 21:47:49 290
原创 Most Powerful ZOJ - 3471
Recently, researchers on Mars have discovered N powerful atoms. All of them are different. These atoms have some properties. When two of these atoms collide, one of them disappears and a lot of power i
2017-07-17 17:21:14 310
原创 Travelling HDU - 3001
After coding so many days,Mr Acmer wants to have a good rest.So travelling is the best choice!He has decided to visit n cities(he insists on seeing all the cities!And he does not mind which city being
2017-07-17 14:34:13 386
原创 Hie with the Pie POJ - 3311(wa)
The Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfortunately, due to cutbacks, they can afford to hire only one driver to do the deliveries. He will wait f
2017-07-17 10:49:52 298
原创 炮兵阵地 POJ - 1185(状态压缩)
司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用”H” 表示),也可能是平原(用”P”表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中黑色区域所示: 如果在地图中的灰色所标识的平原上部署一支炮兵部队,则图中的黑色的网格表示它能够攻击到的区域:沿横向左右各两格
2017-07-16 15:25:06 479
原创 Corn Fields POJ - 3254(状态压缩dp入门)
Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squares. Regrettably, s
2017-07-06 12:37:51 838
原创 Just a Hook HDU - 1698(线段树的懒惰标记)
In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same length. Now Pudge wan
2017-07-02 14:40:15 528
原创 Mishka and Interesting sum CodeForces - 703D(离线处理)
Little Mishka enjoys programming. Since her birthday has just passed, her friends decided to present her with array of non-negative integers a1, a2, …, an of n elements!Mishka loved the array and she i
2017-07-02 14:21:21 388
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人