随笔分类 -  ACM模板

1 2 下一页

Frogger(floyd变形)
摘要:FroggerTime Limit:1000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusPracticePOJ 2253DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full 阅读全文

posted @ 2013-09-06 09:35 铁树银花 阅读(347) 评论(0) 推荐(0)

Til the Cows Come Home(最短路)
摘要:Til the Cows Come HomeTime Limit:1000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusPracticePOJ 2387DescriptionBessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beau 阅读全文

posted @ 2013-09-03 19:45 铁树银花 阅读(2553) 评论(0) 推荐(0)

Digging(DP)
摘要:ZOJ Problem Set - 3689DiggingTime Limit:2 Seconds Memory Limit:65536 KBWhen it comes to theMaya Civilization, we can quickly remind of a term called the end of the world. It's not difficult to understand why we choose to believe the prophecy (or we just assume it is true to entertain ourselves) 阅读全文

posted @ 2013-07-30 11:49 铁树银花 阅读(327) 评论(0) 推荐(0)

Anniversary party(树形dp入门)
摘要:Anniversary partyTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3043Accepted Submission(s): 1374Problem DescriptionThere is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical stru 阅读全文

posted @ 2013-07-21 21:38 铁树银花 阅读(1691) 评论(0) 推荐(0)

A Simple Problem with Integers(线段树区间更新模板题)
摘要:A Simple Problem with IntegersTime Limit:5000MSMemory Limit:131072KB64bit IO Format:%I64d & %I64uSubmitStatusDescriptionYou haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other 阅读全文

posted @ 2013-05-11 09:43 铁树银花 阅读(256) 评论(0) 推荐(0)

最大流EK算法模板(BFS实现)
摘要:变量解释:s-源点d-汇点r[i][j]-残留网络中结点i和结点j间的流量,初始值为边<i,j>的容量flow[i]-记录从源点到结点i的路径<s,...,i>可容纳的最大流量,显然由最短板原理,flow[i]为路径<s,...,i>中容量最少的那一段的容量pre[i]-记录结点i的前驱结点,以便保存增广路径,同时标记已加入队列的结点,避免重复访问 1 #define min(x, y) ((x) < (y) ? (x) : (y)) 2 3 const int maxn = 405; 4 const int inf = 0x7fffffff; 5 i 阅读全文

posted @ 2013-04-28 13:50 铁树银花 阅读(337) 评论(0) 推荐(0)

Drainage Ditches(最大流入门)
摘要:Drainage DitchesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5649Accepted Submission(s): 2666Problem DescriptionEvery time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is 阅读全文

posted @ 2013-04-20 23:04 铁树银花 阅读(332) 评论(0) 推荐(0)

Substring Frequency (KMP)
摘要:Substring FrequencyTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmit Status Practice LightOJ 1255DescriptionA string is a finite sequence of symbols that are chosen from an alphabet. In this problem you are given two non-empty strings A and B, both contain lower case Engli 阅读全文

posted @ 2013-04-08 13:17 铁树银花 阅读(390) 评论(0) 推荐(0)

Harmonic Number(打表法)
摘要:Harmonic Number Time Limit:3000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluSubmit Status Practice LightOJ 1234DescriptionIn mathematics, the nth harmonic number is the sum of the reciprocals of the first n natural numbers:In this problem, you are given n, you have to find Hn.InputInput st 阅读全文

posted @ 2013-04-03 20:08 铁树银花 阅读(611) 评论(0) 推荐(0)

False Ordering(统计因子个数、素因子分解)
摘要:False OrderingTime Limit:1000MSMemory Limit:32768KB64bit IO Format:%lld & %lluSubmitStatusPracticeLightOJ 1109DescriptionWe definebis a Divisor of a numberaifais divisible byb. So, the divisors of 12 are 1, 2, 3, 4, 6, 12. So, 12 has 6 divisors.Now you have to order all the integers from 1 to 10 阅读全文

posted @ 2013-04-02 21:46 铁树银花 阅读(367) 评论(0) 推荐(0)

Ignatius and the Princess II(STL)
摘要:Ignatius and the Princess IITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3163Accepted Submission(s): 1883Problem DescriptionNow our hero finds the door to the BEelzebub feng5166. He opens the door and finds feng5166 is about to kill our pretty P 阅读全文

posted @ 2013-03-22 16:54 铁树银花 阅读(296) 评论(0) 推荐(0)

Codeforces Round #174 (Div. 2) Cows and Primitive Roots(数论)
摘要:Cows and Primitive Rootstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe cows have just learned what a primitive root is! Given a prime p, a primitive root is an integer x (1 ≤ x < p) such that none of integers x - 1, x2 - 1, ..., xp - 2 -  阅读全文

posted @ 2013-03-22 13:46 铁树银花 阅读(341) 评论(0) 推荐(0)

Max Sum(经典DP)
摘要:Max Sum Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1003DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 阅读全文

posted @ 2013-03-03 13:29 铁树银花 阅读(3630) 评论(0) 推荐(0)

最大连续子序列(经典DP)
摘要:最大连续子序列 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1231Description给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ..., Nj },其中 1 <= i <= j <= K。最大连续子序列是所有连续子序列中元素和最大的一个, 例如给定序列{ -2, 11, -4, 13, -5, -2 },其最大连续子序列为{ 11, -4, 13 },最大 阅读全文

posted @ 2013-03-03 12:15 铁树银花 阅读(453) 评论(0) 推荐(0)

Codeforces Round #170 (Div. 2) B. New Problem(好题)
摘要:B. New Problemtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputComing up with a new problem isn't as easy as many people think. Sometimes it is hard enough to name it. We'll consider a title original if it doesn't occur as a substring 阅读全文

posted @ 2013-03-02 21:42 铁树银花 阅读(374) 评论(0) 推荐(0)

Codeforces Round #169 (Div. 2) C. Little Girl and Maximum Sum(线段树区间更新)
摘要:C. Little Girl and Maximum Sumtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe little girl loves the problems on array queries very much.One day she came across a rather well-known problem: you've got an array of n elements (the elements o 阅读全文

posted @ 2013-03-01 17:20 铁树银花 阅读(499) 评论(0) 推荐(0)

Codeforces Round #169 (Div. 2) B. Little Girl and Game(博弈)
摘要:B. Little Girl and Gametime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is de 阅读全文

posted @ 2013-02-26 23:45 铁树银花 阅读(684) 评论(0) 推荐(0)

敌兵布阵(线段树基础)
摘要:浙大研究生复试历年试题,欢迎练习~敌兵布阵Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 23576Accepted Submission(s): 10236Problem Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C 阅读全文

posted @ 2013-02-25 17:29 铁树银花 阅读(266) 评论(0) 推荐(0)

I Hate It(线段树基础)
摘要:I Hate ItTime Limit: 9000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 22019Accepted Submission(s): 8792Problem Description很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到文件结束。在每个 阅读全文

posted @ 2013-02-25 17:27 铁树银花 阅读(251) 评论(0) 推荐(0)

Just a Hook(线段树,成段更新)
摘要:Just a HookTime Limit : 4000/2000ms (Java/Other)Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 7Accepted Submission(s) : 4Problem DescriptionIn 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 me 阅读全文

posted @ 2013-02-25 17:21 铁树银花 阅读(296) 评论(0) 推荐(0)

1 2 下一页

导航