08 2018 档案
摘要:2161: 漫漫上学路Submit Page Summary Time Limit: 2 Sec Memory Limit: 128 Mb Submitted: 26 Solved: 9 Description众所周知,CSU...
阅读全文
摘要:Find IntegerTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1524 Accepted S...
阅读全文
摘要:ACM (ACMers' Chatting Messenger) is a famous instant messaging software developed by Marjar Technology Company. To attract more users,...
阅读全文
摘要:Buy and ResellTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1713 Accepted...
阅读全文
摘要:题意:给出询问a,b求出a,b区段内的最大子串思路:不难想象,一个区段的最大子串要么为其两个子区段的最大子串,要么第一个子串的最大后缀加上第二个子串的最大前缀。因此我们需要维护每一个串的最大前缀,最大后缀,以及最大子串。但是同时需要考虑到,子串的情况会和坐标有关,因此...
阅读全文
摘要:题目大意:在数组中找出三个数,使中间的那个数小于两边的数,问有多少集合。思路:对于每个数来说,它可以组成的组数就是其左边比之小的数乘上右边比之大的数加上右边比之小的数的乘上左边比之大的数。而这些数据可以通过权值树状数组获得AC代码://LA4329#include#i...
阅读全文
摘要:UVALive - 3027 并查集水题,需要注意的是这里不能采用寻常的连根模式,而要直接用节点连接其父节点,而每个节点的到根节点的长度在find函数递归的过程中实现。AC代码:#includeusing namespace std;const int size=2...
阅读全文
摘要:How far away ? HDU - 2586 There are n houses in the village and some bidirectional roads connecting them. Every day peole always like ...
阅读全文
摘要:2151: 集训难度Submit Page Summary Time Limit: 1 Sec Memory Limit: 512 Mb Submitted: 55 Solved: 12 Description小L正在组织ac...
阅读全文
摘要:数论二·Eular质数筛法 HihoCoder - 1295 描述小Ho:小Hi,上次我学会了如何检测一个数是否是质数。于是我又有了一个新的问题,我如何去快速得求解[1,N]这个区间内素数的个数呢?小Hi:你自己有什么想法么?小Ho:有!我一开始的想法是,自然我们已经...
阅读全文
摘要:神、上帝以及老天爷 HDU - 2048 HDU 2006'10 ACM contest的颁奖晚会隆重开始了! 为了活跃气氛,组织者举行了一个别开生面、奖品丰厚的抽奖活动,这个活动的具体要求是这样的: 首先,所有参加晚会的人员都将一张写有自己名字的字条放入抽奖箱中; ...
阅读全文
摘要:最大公约数的辗转相除法(欧几里得算法)证明:给出两个数a和b,求其最大公约数。设a%b=y;则a=k*b+y(k为一整数)设a,b的最小公约数为u则:(k*b+y)%u=0; b%u=0;由(2)式可知k*b%u=0,所以y%u=0所以a,b的最小公约数就可以转换为b...
阅读全文
摘要:在鹅厂工作的DJ开始训练起了鹅厂的企鹅们,现在DJ教小企鹅玩一个疯狂的游戏(危险游戏,小朋友请勿模仿)。现在有一排小企鹅,从左到右编号为1....N,每个小企鹅有一个数字,每天早上,如果一个小企鹅发现他右边的小企鹅的数字比他的小,他就会消灭这个小企鹅。问到了第几天才会...
阅读全文
摘要:点的修改:#include#include#include#include#include#include#include#include#include#include#include#define endl '\n'#define sc(x) scanf("%d"...
阅读全文
摘要:The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral p...
阅读全文
摘要:CC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are o...
阅读全文
摘要:E - Blue Jeans POJ - 3080 The Genographic Project is a research partnership between IBM and The National Geographic Society that is an...
阅读全文
摘要:Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 #include#include#include#include#include#...
阅读全文
摘要:Prefixes and Suffixes CodeForces - 432D You have a string s = s1s2...s|s|, where |s| is the length of string s, and si its i-th charac...
阅读全文
摘要:本题的题目选择的是病毒侵袭持续中 HDU - 3065 const int size=5e4+5;const int SIGMA_SIZE=26;int trie[size][26],val[size];char s_save[1005][60],s_fin[2000...
阅读全文
摘要:KiKi's K-Number HDU - 2852 For the k-th number, we all should be very familiar with it. Of course,to kiki it is also simple. Now Kiki ...
阅读全文
摘要:In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swap...
阅读全文
摘要:树状数组模板://Cnt为数组的界//cnt[i]为编号或者数值上小于id的数量void Update(LL Id){ while(Id0) { ans+=cnt[Id]; Id-=lowbit(Id); } return ans;}离散化//arr为保存原数据的...
阅读全文
摘要:二维平面上N个点之间共有C(n,2)条连线。求这C(n,2)条线中斜率小于0的线的数量。二维平面上的一个点,根据对应的X Y坐标可以表示为(X,Y)。例如:(2,3) (3,4) (1,5) (4,6),其中(1,5)同(2,3)(3,4)的连线斜率 #include...
阅读全文
摘要:A new form of life is recently discovered on Mars. Every alien has a DNA, that is a string with an alphabet of only two, rather than f...
阅读全文
摘要:A supermarket in Tehran is open 24 hours a day every day and needs a number of cashiers to fit its need. The supermarket manager has h...
阅读全文
摘要:杭州有N个景区,景区之间有一些双向的路来连接,现在8600想找一条旅游路线,这个路线从A点出发并且最后回到A点,假设经过的路线为V1,V2,....VK,V1,那么必须满足K>2,就是说至除了出发点以外至少要经过2个其他不同的景区,而且不能重复经过同一个景区。现在86...
阅读全文
摘要:Weiwei is a software engineer of ShiningSoft. He has just excellently fulfilled a software project with his fellow workers. His boss i...
阅读全文
摘要:在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗? Input输入包括多组数据。每组数据第一行是两个整数N、...
阅读全文
摘要:The Suspects UVA - 1197 并查集模板题,记得维护一下并查集的大小就好代码:#include#include#include#include#include#include#include#include#include#include#inclu...
阅读全文
摘要:给出n个点将他们连成最小生成树,给出k个卫星,有了这些卫星就可以无代价地连接一些边。求出在此条件下的最长的边也就是求出最小生成树的第k小条边考虑到这个图的边比较多,选择使用prim算法,需要注意的是,先生成的边不一定小,后生成的边也不一定大代码:#include#in...
阅读全文
摘要:Networking UVALive - 2515 kruskal模板题了,不解释#include#include#include#include#include#include#include#include#include#include#include#defi...
阅读全文
摘要:Almost Union-Find UVA - 11987 这题的重点在于一些点会被删除,但是我们知道,如果不是根节点的还好,一旦删除根节点,该并查集的结构就被严重破坏了,因此我们选择设置一个虚点,他不存在,也不贡献点的数量,也不贡献值,仅仅是存在于那里为我们来维持结...
阅读全文
摘要:X-Plosives UVA - 1160 A secret service developed a new kind of explosive that attain its volatile property only when a specific associ...
阅读全文
摘要:食物链Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 90551 Accepted: 27213 Description动物王国中有三类动物A,B,C,这三类动物的食物链...
阅读全文
摘要:A Bug's LifeTime Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 19429 Accepted...
阅读全文
摘要:A - Tri Tiling POJ - 2663 In how many ways can you tile a 3xn rectangle with 2x1 dominoes? Here is a sample tiling of a 3x12 rectangle...
阅读全文
摘要:1592:石子归并提交页面 概要 时间限制: 1秒 内存限制:128 Mb已 提交: 913已 解决: 435 描述现在有Ñ堆石子,第我堆有人工智能个石子。现在要把这些石子合并成一堆,每次只能合并相邻两个,每次合并的代价是两堆...
阅读全文
摘要:A - Race UVA - 12034 Description Tamim and Lina, two of the biggest mega minds of Bangladesh went to a far country. They ate, coded an...
阅读全文
摘要:B - Selling Land UVA - 12265 As you may know, the country of Absurdistanis full of abnormalities. For example, the whole country can b...
阅读全文
摘要:一、引例 1、一类不等式组的解二、最短路 1、Dijkstra 2、图的存储 3、链式前向星 4、Dijkstra + 优先队列 5、Bellman-Ford 6、SPFA 7、Floyd...
阅读全文
摘要:UVA - 1599 Ideal Path New labyrinth attraction is open in New Lostland amusement park. The labyrinth consists of n rooms connected b...
阅读全文
摘要:A. Pythagorean Theorem IICodeForces - 304A http://codeforces.com/problemset/problem/304/Atime limit per test3 secondsmemory limit per ...
阅读全文
摘要:Anniversary partyTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 16631 Acce...
阅读全文
摘要:在我们日常的编码中,计算机通常使用一些二进制位串来标记对象,如ascll码。但是很多时候由于在一个内容中,不同的对象出现的频率不同,8位的ascii码其实有许多空间上的浪费。为了减少这种浪费,我们选择使用一些别的方法来储存这些对象。即我们接下来讲到的哈夫曼编码具体的定...
阅读全文
摘要:今天学习到了dp(其实以前就学过,不过没学好),再次看到背包问题的时候,突然意识到空间优化过后,他对剩余体积的遍历方式改变了!看看背包九讲上的伪代码:这是优化空间之前的这是优化空间之后的。也是想了一下才想明白。先来看看优化空间之前的情况不难发现在优化空间之前,对于每一...
阅读全文

浙公网安备 33010602011771号