- 博客(137)
- 收藏
- 关注
原创 POJ - 3186【dp】
Treats for the CowsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 5507 Accepted: 2871DescriptionFJ has purchased N (1 The treats are interesting for
2017-01-24 17:33:48
332
原创 POJ - 3268 【改变边方向 + dijk】
Silver Cow PartyOne cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤X ≤ N). A total of M (1 ≤ M ≤ 100,000) unidire
2017-01-24 17:23:00
576
原创 codeforces 760E or 759C 【线段树维护后缀和】
C. Nikita and stacktime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputNikita has a stack. A stack in this problem is a
2017-01-24 17:15:10
697
原创 BZOJ - 1007 【单调栈】
007: [HNOI2008]水平可见直线Time Limit: 1 Sec Memory Limit: 162 MBSubmit: 6614 Solved: 2519[Submit][Status][Discuss]Description 在xoy直角坐标平面上有n条直线L1,L2,...Ln,若在y值为正无穷大处往下看,能见到Li的某个子线段,则称Li为可
2017-01-24 17:03:34
457
原创 HDU - 5269【SBBBBBB Trie】
ZYB loves Xor ITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 979 Accepted Submission(s): 436Problem DescriptionMemphis loves xo
2017-01-18 22:25:03
1127
原创 codeforces - 276D【贪心+数学】
D. Little Girl and Maximum XORtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA little girl loves problems on bitwis
2017-01-16 20:31:48
326
原创 BZOJ - 1003【dp+最短路】
1003: [ZJOI2006]物流运输Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 7062 Solved: 2929[Submit][Status][Discuss]Description 物流公司要把一批货物从码头A运到码头B。由于货物量比较大,需要n天才能运完。货物运输过程中一般要转停好几个码头。物流公司
2017-01-16 20:23:53
330
原创 SPOJ - Palin Square【预处理+枚举】
PLSQUARE - Palin Square#dynamic-programming#hashingKids just learnt about palindrome strings yesterday. Today, the teacher today was going to teach them about square shapes. But kids we
2017-01-15 21:40:28
342
原创 SPOJ - Horace and his primes【奇淫打表+二分】
TAP2013H - Horace and his primesno tags [The original version of this problem (in Spanish) can be found athttp://www.dc.uba.ar/events/icpc/download/problems/tap2013-problems.pdf]Hora
2017-01-15 21:22:13
286
原创 SPOJ - Linearian Colony【分解为子问题】
COLONY - Linearian Colonyno tags DescriptionLinearians are pecurliar creatures. They are odd in several ways:Every Linearian is either red or blue.A Linearian colony is a straight
2017-01-15 21:01:22
391
原创 HDU - 1269【Tarjan最大强连通分量】
迷宫城堡 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submissi
2017-01-15 20:41:21
235
原创 bzoj - 1002 【Kirchhoff矩阵】
1002: [FJOI2007]轮状病毒Time Limit: 1 Sec Memory Limit: 162 MBSubmit: 4746 Solved: 2597[Submit][Status][Discuss]Description 轮状病毒有很多变种,所有轮状病毒的变种都是从一个轮状基产生的。一个N轮状基由圆环上N个不同的基原子和圆心处一个核原子构成的
2017-01-15 20:31:34
394
原创 nwu 新生题解【第一套】
A:【读题+细节】【排序+贪心】题意:有n张牌,分给n/2个人,每人两张,要求每个人牌上的数值之和相等,输入保证有解。题解:先将所有牌面排序,那么依次给每个人分配【最小,最大】【次小,次大】。。。。。。即可【学习按关键字排序】#include #include #include #include #include #include #include #incl
2016-12-23 13:47:28
330
原创 codeforces #371div2 (ABC)
A. Meeting of Old Friendstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputToday an outstanding event is goin
2016-09-14 20:06:48
771
原创 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
385
原创 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
220
转载 树状数组
对于普通数组,其修改的时间复杂度位O(1),而求数组中某一段的数值和的时间复杂度为O(n),因此对于n的值过大的情况,普通数组的时间复杂度我们是接受不了的。在此,我们引入了树状数组的数据结构,它能在O(logn)内对数组的值进行修改和查询某一段数值的和。树状数组是一个查询和修改复杂度都为log(n)的数据结构,假设数组a[1..n],那么查询a[1]+...+a[n]的时间是log
2016-07-30 08:41:47
216
原创 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
286
原创 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
555
原创 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
533
原创 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
277
原创 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
849
原创 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
315
原创 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
601
原创 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
387
原创 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
217
原创 暑期第一弹<搜索> 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
665
原创 暑期第一弹<搜索> 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
4439
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
372
原创 暑期第一弹<搜索> 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
1622
1
原创 暑期第一弹<搜索> A - 棋盘问题(简单dfs)
A - 棋盘问题Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64uSubmit StatusDescription在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对
2016-07-11 17:08:48
1367
原创 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
290
原创 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
225
原创 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
1538
原创 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
221
原创 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
701
原创 cf #360 div2C - NP-Hard Problem(二分图判断+输出)
C. NP-Hard Problemtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently, Pari and Arya did some researc
2016-06-30 23:13:12
896
2
原创 cf - 670C Cinema(预处理)
题目链接:http://codeforces.com/contest/670/problem/C#include #include #include #include #define MAX 200005using namespace std;/*********************************************************************
2016-06-20 01:54:12
484
1
原创 cf #345 div2 C(Vasya and String。双端队列)
题目链接:http://codeforces.com/contest/676/problem/C#include #include #include using namespace std;/*************************************************************************************************
2016-06-13 12:27:10
609
原创 PAT - L2-011. 玩转二叉树(分冶)
L2-011. 玩转二叉树时间限制400 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者陈越给定一棵二叉树的中序遍历和前序遍历,请你先将树做个镜面反转,再输出反转后的层序遍历的序列。所谓镜面反转,是指将所有非叶结点的左
2016-06-04 23:36:49
3713
3
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人