- 博客(80)
- 资源 (4)
- 收藏
- 关注
原创 zoj3348 网络流
ScheduleTime Limit: 1 Second Memory Limit: 32768 KB DD enters the top-level pingpong match! As the game going on, he wonders if there is possibility for him to get the champion(excluding j
2014-08-13 00:10:21 722
原创 zoj3336 模拟
Friend Number IITime Limit: 1 Second Memory Limit: 32768 KB Given a positive integer x, let S(x) denotes the sum of all x's digits. Two integersx and y are friend numbers if S(x)=S(y). H
2014-08-12 21:09:04 450
原创 poj2096 期望
Collecting BugsTime Limit: 10000MS Memory Limit: 64000KTotal Submissions: 2387 Accepted: 1151Case Time Limit: 2000MS Special JudgeDescriptionIvan is f
2014-08-11 15:56:19 444
原创 zoj3329 期望
One Person GameTime Limit: 1 Second Memory Limit: 32768 KB Special JudgeThere is a very simple and interesting one-person game. You have 3 dice, namely Die1, Die2 and Die3. Die1 has K1 faces.
2014-08-11 15:07:25 341
原创 zoj3306 状压DP
Kill the MonstersTime Limit: 7 Seconds Memory Limit: 32768 KB In order to celebrate the 8th anniversary of ZOJ, watashi introduces a strange game to other ZJU ACM team members. The board o
2014-08-08 18:22:24 558
原创 zoj3488
Conic SectionTime Limit: 2 Seconds Memory Limit: 65536 KB The conic sections are the nondegenerate curves generated by the intersections of a plane with one or two nappes of a cone. For a
2014-08-07 19:22:47 447
原创 zoj3471
Most PowerfulTime Limit: 2 Seconds Memory Limit: 65536 KB Recently, researchers on Mars have discovered N powerful atoms. All of them are different. These atoms have some properties. When
2014-08-07 16:39:17 438
原创 zoj3468 dp
Dice WarTime Limit: 2 Seconds Memory Limit: 65536 KB Special Judge Dice war is a board game. In each turn, the attacker will choose a pile of dices to attack the defender's pile of dices.
2014-08-05 21:56:18 381
原创 zoj3416 数位DP
Balanced NumberTime Limit: 5 Seconds Memory Limit: 65536 KB A balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specifically, imagine
2014-08-05 17:44:36 437
原创 zoj3405 卡特兰数
Counting Factor TreesTime Limit: 2 Seconds Memory Limit: 65536 KB Factoring, i.e., listing all the prime factors, of an integer is a useful skill that often helps to solve math problems. F
2014-08-03 23:05:25 675
转载 Catalan数计算及应用
问题描述:卡塔兰数,是组合数学中一个常出现在各种计数问题中出现的数列。输入一个整数n,计算h(n)。其递归式如下:h(n)= h(0)*h(n-1)+h(1)*h(n-2) + ... + h(n-1)h(0) (其中n>=2,h(0) = h(1) = 1) 该递推关系的解为:h(n)=C(2n,n)/(n+1) (n=1,2,3,...)思路:直接根据递归式,写出相应的算法。
2014-08-03 20:43:49 484
原创 zoj3511(暴力)
Cake RobberyTime Limit: 2 Seconds Memory Limit: 65536 KB As usual, Alice finishes her delicious cake at noon. Unfortunately, the smell of cake beckoned hungry Bob, and he decided to rob on
2014-08-01 16:43:34 370
原创 zoj3516 线段树
Tree of ThreeTime Limit: 2 Seconds Memory Limit: 65536 KB Now we have a tree and some queries to deal with. Every node in the tree has a value on it. For one nodeA, we want to know the l
2014-08-01 12:24:45 480
原创 zoj3529
A Game Between Alice and BobTime Limit: 5 Seconds Memory Limit: 262144 KB Alice and Bob play the following game. A series of numbers is written on the blackboard. Alice and Bob take turns
2014-07-31 23:42:32 463
原创 zoj3543
Number StringTime Limit: 5 Seconds Memory Limit: 65536 KB The signature of a permutation is a string that is computed as follows: for each pair of consecutive elements of the permutation,
2014-07-31 16:20:30 555
原创 zoj3547
The Boss on MarsTime Limit: 2 Seconds Memory Limit: 65536 KB On Mars, there is a huge company called ACM (A huge Company on Mars), and it’s owned by a younger boss.Due to no moons around
2014-07-29 13:16:12 455
转载 二分图最大匹配
二分图指的是这样一种图,其所有顶点可以分成两个集合X和Y,其中X或Y中任意两个在同一集合中的点都不相连,所有的边关联在两个顶点中,恰好一个属于集合X,另一个属于集合Y。给定一个二分图G,M为G边集的一个子集,如果M满足当中的任意两条边都不依附于同一个顶点,则称M是一个匹配。图中包含边数最多的匹配称为图的最大匹配。二分图的最大匹配有两种求法,第一种是最大流;第二种就是我现在要讲的匈牙利算法。这个
2014-07-20 21:49:50 487
原创 zoj3607
Lazier SalesgirlTime Limit: 2 Seconds Memory Limit: 65536 KB Kochiya Sanae is a lazy girl who makes and sells bread. She is an expert at bread making and selling. She can sell thei-th cu
2014-06-28 16:15:14 549
原创 zoj3662
Math MagicTime Limit: 3 Seconds Memory Limit: 32768 KB Yesterday, my teacher taught us about math: +, -, *, /, GCD, LCM... As you know, LCM (Least common multiple) of two positive numbers ca
2014-06-13 11:52:48 443
原创 zoj3703
Happy Programming ContestTime Limit: 2 Seconds Memory Limit: 65536 KB In Zhejiang University Programming Contest, a team is called "couple team" if it consists of only two students loving ea
2014-06-08 15:26:40 503
转载 KMP中next之我的个人理解
为什么最后一位就是答案???例如有p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12的长度为12的串。假设第13位的next对应的是8,从kmp角度来说意思就是:p1 p2 p3 p4 p5 p6 p7 p8= p5 p6 p7 p8 p9 p10 p11 p12,这时我们可以找到这样一种关系,p1 p2 p3 p4= p5 p6 p7 p8=p9 p
2014-05-26 08:57:51 447
原创 zoj3725s
Painting StoragesTime Limit: 2 Seconds Memory Limit: 65536 KB There is a straight highway with N storages alongside it labeled by1,2,3,...,N. Bob asks you to paint all storages with two
2014-05-25 22:00:16 382
原创 zoj 3726
Alice's Print ServiceTime Limit: 2 Seconds Memory Limit: 65536 KB Alice is providing print service, while the pricing doesn't seem to be reasonable, so people using her print service
2014-02-18 00:07:03 677
原创 zoj 3710
FriendsTime Limit: 2 Seconds Memory Limit: 65536 KB Alice lives in the country where people like to make friends. The friendship is bidirectional and if any two person have no less than
2014-02-09 00:38:44 609
转载 有向图强连通分量的Tarjan算法
[有向图强连通分量]在有向图G中,如果两个顶点间至少存在一条路径,称两个顶点强连通(strongly connected)。如果有向图G的每两个顶点都强连通,称G是一个强连通图。非强连通图有向图的极大强连通子图,称为强连通分量(strongly connected components)。下图中,子图{1,2,3,4}为一个强连通分量,因为顶点1,2,3,4两两可达。{5},{6}也分别是
2014-02-04 14:07:12 388
转载 STL Vector
vector是C++标准模板库中的部分内容,它是一个多功能的,能够操作多种数据结构和算法的模板类和函数库。vector之所以被认为是一个容器,是因为它能够像容器一样存放各种类型的对象,简单地说,vector是一个能够存放任意类型的动态数组,能够增加和压缩数据。 为了可以使用vector,必须在你的头文件中包含下面的代码: #include vector属于std命名
2013-12-15 15:50:20 424
转载 ZOJ-3334 Body Check
Problem DescriptionDue to the spread of H1N1 all over the world, the king of Kingdom atouSK is so afraid that he decides to ask all his people to do a body check, no matter how much money it will ta
2013-12-10 19:37:28 1370 1
转载 单调队列
正文单调队列,望文生义,就是指队列中的元素是单调的。如:{a1,a2,a3,a4……an}满足a1序列便是单调递增序列。同理递减队列也是存在的。单调队列的出现可以简化问题,队首元素便是最大(小)值,这样,选取最大(小)值的复杂度便为o(1),由于队列的性质,每个元素入队一次,出队一次,维护队列的复杂度均摊下来便是o(1)。如何维护单调队列呢,以单调递增序列为例:1、
2013-12-08 13:14:11 633
原创 Under Attack II
Problem DescriptionBecause of the sucessfully calculation in Under Attack I, Doctor is awarded with Courage Cross and promoted to lieutenant. But the war seems to end in never, now Doctor has a new
2013-11-29 18:44:08 535
转载 KMP算法详解(转)
引记 此前一天,一位MS的朋友邀我一起去与他讨论快速排序,红黑树,字典树,B树、后缀树,包括KMP算法,唯独在讲解KMP算法的时候,言语磕磕碰碰,我想,原因有二:1、博客内的东西不常回顾,忘了不少;2、便是我对KMP算法的理解还不够彻底,自不用说讲解自如,运用自如了。所以,特再写本篇文章。由于此前,个人已经写过关于KMP算法的两篇文章,所以,本文名为:KMP算法之总结篇。
2013-11-28 19:04:54 506
原创 Round #5 Problem B
Problem DescriptionJohn Doe has recently found a "Free Market" in his city that is the place where you can exchange some of your possessions for other things for free.John knows that his city
2013-11-26 19:59:40 525
转载 HashMap用法
map是STL的一个关联容器,它提供一对一(其中第一个可以称为关键字,每个关键字只能在map中出现一次,第二个可能称为该关键字的值)的数据处理能力,由于这个特性,它完成有可能在我们处理一对一数据的时候,在编程上提供快速通道。这里说下map内部数据的组织,map内部自建一颗红黑树(一种非严格意义上的平衡二叉树),这颗树具有对数据自动排序的功能,所以在map内部所有的数据都是有序的,后边我们会见识到有
2013-11-26 13:27:41 754 1
转载 C++ STL Pair
Pair类型概述pair是一种模板类型,其中包含两个数据值,两个数据的类型可以不同,基本的定义如下: pair a;表示a中有两个类型,第一个元素是int型的,第二个元素是string类型的,如果创建pair的时候没有对其进行初始化,则调用默认构造函数对其初始化。 pair a("James", "Joy");也可以像上面一样在定义的时候直接
2013-11-26 13:16:54 471
转载 C++ STACK Queue
stack(栈)和queue(队列)也是在程序设计中经常会用到的数据容器,STL为我们提供了方便的stack(栈)的queue(队列)的实现。准确地说,STL中的stack和queue不同于vector、list等容器,而是对这些容器的重新包装。这里我们不去深入讨论STL的stack和queue的实现细节,而是来了解一些他们的基本使用。1、stackstack模
2013-11-26 13:11:31 433
转载 C++ Set和multiset常用用法
set集合容器:实现了红黑树的平衡二叉检索树的数据结构,插入元素时,它会自动调整二叉树的排列,把元素放到适当的位置,以保证每个子树根节点键值大于左子树所有节点的键值,小于右子树所有节点的键值;另外,还得保证根节点左子树的高度与右子树高度相等。平衡二叉检索树使用中序遍历算法,检索效率高于vector、deque和list等容器,另外使用中序遍历可将键值按照从小到大遍历出来。构造set集合主要
2013-11-26 12:54:26 695
转载 C++ map的基本操作和使用
Map是c++的一个标准容器,她提供了很好一对一的关系,在一些程序中建立一个map可以起到事半功倍的效果,总结了一些map基本简单实用的操作!1. map最基本的构造函数; mapmapstring; mapmapint; mapmapstring; mapmapchar; mapmapchar; map
2013-11-26 12:50:29 403
Reflection.rar
2020-01-12
OpenGL ES 2.0编程向导中文版 + OpenGL ES 3.0编程指南中文版
2019-03-27
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人