- 博客(107)
- 收藏
- 关注
原创 邻接表构建模板
int cnt=0;struct Node{ int fr;//起点 int to;//终点 int l;//边权 int next;//指向上一条边}e[maxn*5];int head[maxn*5];//head[i]是起点为i的表头void add(int a,int b,int c){ e[cnt].fr=a; e[cnt].to
2017-07-17 20:53:06 366
原创 拓扑排序
有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时P1在P2之前。现在请你编程序确定排名。 Input 输入有若干组,每组中的第一行为二个数N(1<=N<=500),M;其中N表示队伍的个数,M表示接着有
2017-07-17 18:48:01 195
原创 HDU 1455
SticksTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 10645 Accepted Submission(s): 3206Problem Description George took sticks of the same
2017-07-17 16:17:46 245
原创 HDU 1584 蜘蛛牌(DFS)
蜘蛛牌Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4013 Accepted Submission(s): 1723Problem Description 蜘蛛牌是windows xp操作系统自带的一款纸牌游戏,游戏规则是这
2017-07-16 20:41:31 308
原创 POJ 3258(二分——最大化最小值)
River Hopscotch Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 14284 Accepted: 6059 DescriptionEvery year the cows hold an event featuring a peculiar version of hopscotch tha
2017-07-16 20:16:54 242
原创 POJ 3258(二分——最大化最小值)
River Hopscotch Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 14284 Accepted: 6059 DescriptionEvery year the cows hold an event featuring a peculiar version of hopscotch tha
2017-07-16 20:16:04 331
原创 HDU 3172 Virtual Friends(并查集+map+输入)
Virtual FriendsTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 9156 Accepted Submission(s): 2644Problem Description These days, you can do
2017-07-16 19:40:05 266
原创 POJ 3111 K Best(二分——最大化平均值)
K Best Time Limit: 8000MS Memory Limit: 65536K Total Submissions: 10457 Accepted: 2695 Case Time Limit: 2000MS Special Judge DescriptionDemy has n jewels. Each of her jewels has som
2017-07-16 10:18:30 328
原创 HDU 1754 I Hate it
I Hate ItTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 77616 Accepted Submission(s): 29868Problem Description 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到
2017-07-15 21:20:40 242
原创 ZOJ 3261 Connections in Galaxy War(并查集+思维+STL数据结构)
ZOJ Problem Set - 3261 Connections in Galaxy War Time Limit: 3 Seconds Memory Limit: 32768 KB In order to strengthen the defense ability, many stars in galaxy allied together and built many bid
2017-07-15 14:45:04 409
原创 POJ 1733 Parity Game(并查集+数据的离散化)
Parity game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9098 Accepted: 3522 DescriptionNow and then you play the following game with your friend. Your friend writes down a se
2017-07-15 10:18:51 378
原创 二分三分总结(需要注意点)
上下界的确定一般上下界的确定是根据二分对象的最大值和最小值来确定的; 如果没有最大或最小值,就根据数据范围来设置最大值和最小值;根据二分对象的状态决定二分形式离散状态(浮点数)最好用的形式是for(int i=0;i<time;i++){...}或者while(end-st>eps)推荐前者的写法,后者容易卡精度。 而满足条件时,直接st=mid或end=mid即可对于整数则一般是int
2017-07-14 22:15:56 308
原创 Cable Master(二分)
Inhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Committee has volunteered and has promised to organize the most honest contest ever. It was decided to co
2017-07-14 22:04:45 390
原创 POJ 1456 SuperMarket
Supermarket Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 13144 Accepted: 5882 Description A supermarket has a set Prod of products on sale. It earns a profit px for each product x∈P
2017-07-13 19:57:38 301
原创 Vasya and String(尺取 贪心)
High school student Vasya got a string of length n as a birthday present. This string consists of letters ‘a’ and ‘b’ only. Vasya denotes beauty of the string as the maximum length of a substring (cons
2017-07-13 13:57:49 541
原创 NPY and shot (三分求峰值)
NPY is going to have a PE test.One of the test subjects is throwing the shot.The height of NPY is H meters.He can throw the shot at the speed of v0 m/s and at the height of exactly H meters.He wonders
2017-07-13 13:43:00 441
原创 Median (Binery Search)
Given N numbers, X1, X2, … , XN, let us calculate the difference of every pair of numbers: ∣Xi - Xj∣ (1 ≤ i < j ≤ N). We can get C(N,2) differences through this work, and now your task is to find the m
2017-07-13 13:31:12 378
原创 The Meeting Place Can Not Be Changed(二分)
The main road in Bytecity is a straight line from south to north. Conveniently, there are coordinates measured in meters from the southernmost building in north direction.At some points on the road the
2017-07-13 11:39:09 314
原创 Can you solve the equation?(二分求方程解)
Now,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100; Now please try your lucky. Input The first line of the input contains an integer T(1<=T<=100
2017-07-12 23:22:57 663
原创 HDU 1182 食物链(并查集和偏移向量)
食物链 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 73179 Accepted: 21733 Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到
2017-07-11 22:17:51 475
原创 HDU 3038 How Many Answers Are Wrong(并查集和偏移向量)
TT and FF are ... friends. Uh... very very good friends -________-bFF 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 shoul
2017-07-11 19:06:45 286
原创 线段树模板
#include #include #include #include #include #define maxn 199999using namespace std;int num[maxn];int segtree[maxn];void plant(int node ,int l,int r){ if(l==r){segtree[nod
2017-07-11 15:44:31 250
原创 HDU 1213 How Many Tables(并查集统计求不同集合个数)
How Many TablesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 31224 Accepted Submission(s): 15516Problem DescriptionToday is
2017-07-11 15:19:42 537
原创 POJ 1611 The Suspects(并查集求集合的基数)
The Suspects Time Limit: 1000MS Memory Limit: 20000KTotal Submissions: 38785 Accepted: 18796DescriptionSevere acute respiratory syndrome (SARS), an atypical pneumo
2017-07-11 14:53:58 282
原创 POJ 2236
Wireless NetworkTime Limit: 10000MS Memory Limit: 65536KTotal Submissions: 28334 Accepted: 11724DescriptionAn earthquake takes place in Southeast Asia. The ACM (A
2017-07-11 14:25:51 282
原创 HDU 1005 Number Sequence(找规律)
Number SequenceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 171269 Accepted Submission(s): 42263Problem DescriptionA numbe
2017-05-10 21:11:54 303
原创 HDU 1003 Max Sum
Max SumTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 243667 Accepted Submission(s): 57534Problem DescriptionGiven a sequenc
2017-05-10 13:21:15 265
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人