- 博客(22)
- 收藏
- 关注
原创 HDU - 5775 Bubble Sort(树状数组)
Bubble SortTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 659 Accepted Submission(s): 393Problem DescriptionP is a permutati
2016-07-30 09:07:48 364
原创 HDU - 1556 Color the ball(树状数组 or 线段树)
Color the ballTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 16484 Accepted Submission(s): 8201Problem DescriptionN个气球排成一排,从
2016-07-30 08:53:59 203
转载 树状数组
对于普通数组,其修改的时间复杂度位O(1),而求数组中某一段的数值和的时间复杂度为O(n),因此对于n的值过大的情况,普通数组的时间复杂度我们是接受不了的。在此,我们引入了树状数组的数据结构,它能在O(logn)内对数组的值进行修改和查询某一段数值的和。树状数组是一个查询和修改复杂度都为log(n)的数据结构,假设数组a[1..n],那么查询a[1]+...+a[n]的时间是log
2016-07-30 08:41:47 195
原创 HDU - 1541 Stars(树状数组)
同学们~ StarsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7966 Accepted Submission(s): 3181Problem DescriptionAst
2016-07-30 08:35:16 264
原创 cf - 140 C. New Year Snowmen(贪心+优先队列)
C. New Year Snowmentime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs meticulous Gerald sets the table and
2016-07-28 10:30:41 536
原创 cf - 140 A. New Year Table(模拟)
A. New Year Tabletime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputGerald is setting the New Year table. The
2016-07-28 10:14:10 515
原创 51nod - 1136 欧拉函数(欧拉函数)
1136 欧拉函数基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注对正整数n,欧拉函数是少于或等于n的数中与n互质的数的数目。此函数以其首名研究者欧拉命名,它又称为Euler's totient function、φ函数、欧拉商数等。例如:φ(8) = 4(Phi(8) = 4),因为1,3,5,7
2016-07-28 10:03:31 257
原创 51nod - 1019 逆序数(归并排序or线段树)
1019 逆序数基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注在一个排列中,如果一对数的前后位置与大小顺序相反,即前面的数大于后面的数,那么它们就称为一个逆序。一个排列中逆序的总数就称为这个排列的逆序数。如2 4 3 1中,2 1,4 3,4 1,3 1是逆序,逆序数是4。给出一个整数序列
2016-07-28 09:52:27 824
原创 POJ 2376 - Cleaning Shifts(最小区间覆盖)
Cleaning ShiftsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 17736 Accepted: 4516DescriptionFarmer John is assigning some of his N (1 <= N <= 25,000)
2016-07-24 16:17:16 294
原创 cf - 629D Babaei and Birthday Cake(DP+线段树维护)
D - Babaei and Birthday CakeTime Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit Status Practice CodeForces 629DAppoint description: System Crawler (201
2016-07-15 15:10:57 571
原创 POJ 3468 - A Simple Problem with Integers(线段树,区间更新)
C - A Simple Problem with IntegersTime Limit:5000MS Memory Limit:131072KB 64bit IO Format:%I64d & %I64uSubmit Status Practice POJ 3468Appoint description: qingping (2015-08-
2016-07-15 15:02:42 365
原创 HDU 1166 - 敌兵布阵(线段树,单点更新)
A - 敌兵布阵Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 1166Appoint description: devtang (2012-08-01)System Crawler (2016-07-
2016-07-15 14:53:52 198
原创 暑期第一弹<搜索> E - Find The Multiple(DFS)
E - Find The MultipleTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionGiven a positive integer n, write a program to find out a
2016-07-11 17:55:38 648
原创 暑期第一弹<搜索> D - Fliptile(黑白棋翻转经典题型 DFS)
D - FliptileTime Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionFarmer John knows that an intellectually satisfied cow is a happy
2016-07-11 17:44:37 4408 2
原创 暑期第一弹<搜索> C - Catch That Cow(BFS)
C - Catch That CowTime Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionFarmer John has been informed of the location of a fugitive
2016-07-11 17:31:36 355
原创 暑期第一弹<搜索> B - Dungeon Master(三维BFS,6个状态)
B - Dungeon MasterTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionYou are trapped in a 3D dungeon and need to find the quickes
2016-07-11 17:24:57 1589 1
原创 暑期第一弹<搜索> A - 棋盘问题(简单dfs)
A - 棋盘问题Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64uSubmit StatusDescription在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对
2016-07-11 17:08:48 1343
原创 NWU CCCC 1017(HDU 1272改编 并查集判断图是否存在环)
Evio与观察小白鼠Time Limit : 3000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other)Total Submission(s) : 13 Accepted Submission(s) : 3Font: Times New Roman | Verdana | Georgia
2016-07-09 16:57:02 263
原创 NWU CCCC 1014(又是二叉树分冶)
题目描述很简单Time Limit : 3000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other)Total Submission(s) : 12 Accepted Submission(s) : 2Font: Times New Roman | Verdana | GeorgiaFon
2016-07-07 22:01:45 208
原创 NWU CCCC选拔赛 1014阶乘问题(思维题)
阶乘问题Time Limit : 3000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other)Total Submission(s) : 21 Accepted Submission(s) : 4Font: Times New Roman | Verdana | GeorgiaFont S
2016-07-07 21:58:38 1517
原创 hdu - 1556 (Color the ball 线段树)
题目链接:点击打开链接思路:简单的线段树模板,理解了好久。创建+更新+查询。更新只涉及到区间更新次数(+1)即可。查询可以递归查询,累加包含查询结点的树结点(即离散化的区间[l,r])的次数即可。简单的说就是,查询结点所在的区间更新次数的总和。eg:离散化到树结点,若共有4个结点,更新区间[1,3]则更新到区间[1,2]+[3,3].#include #include #inclu
2016-07-02 23:31:19 205
原创 cf #360 div2 D-Remainders Game(中国剩余定理)
D. Remainders Gametime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputToday Pari and Arya are playing a game ca
2016-07-01 00:59:31 683
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人