- 博客(69)
- 收藏
- 关注
原创 NYOJ 179-LK's problem【模拟】
LK's problem时间限制:3000 ms | 内存限制:65535 KB难度:1描述LK has a question.Coule you help her?It is the beginning of the day at a bank, and a crowd of clients is already waiting for the en
2016-04-30 08:47:21 469
原创 NYOJ 488-素数环【dfs】
素数环时间限制:1000 ms | 内存限制:65535 KB难度:2描述有一个整数n,把从1到n的数字无重复的排列成环,且使每相邻两个数(包括首尾)的和都为素数,称为素数环。为了简便起见,我们规定每个素数环都从1开始。例如,下图就是6的一个素数环。输入有多组测试数据,每组输入一个n(0<n<20),n=0表示输入结束。输出每组第一行输出对应...
2016-04-29 22:25:19 386
原创 NYOJ 1185-最大最小值【线段树:模板--学习ing】
最大最小值时间限制:1000 ms | 内存限制:65535 KB难度:2描述给出N个整数,执行M次询问。对于每次询问,首先输入三个整数C、L、R: 如果C等于1,输出第L个数到第R个数之间的最小值; 如果C等于2,输出第L个数到第R个数之间的最大值; 如果C等于3,输出第L个数到第R个数之间的最小值与最大值的和
2016-04-29 21:36:49 379
原创 ♥NYOJ 123-士兵杀敌(四)【线段树&&树状数组】
士兵杀敌(四)时间限制:2000 ms | 内存限制:65535 KB难度:5描述南将军麾下有百万精兵,现已知共有M个士兵,编号为1~M,每次有任务的时候,总会有一批编号连在一起人请战(编号相近的人经常在一块,相互之间比较熟悉),最终他们获得的军功,也将会平分到每个人身上,这样,有时候,计算他们中的哪一个人到底有多少军功就是一个比较困难的事情,军师小工的
2016-04-29 19:54:48 354
原创 LightOJ 1389 - Scarecrow【模拟】
1389 - Scarecrow PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBTaso owns a very long field. He plans to grow different types o
2016-04-29 13:47:10 424
原创 北京林业大学“计蒜客”杯程序设计竞赛 网络赛 D-A letter from Chensg【最长公共子序列LCS】
Can it really be 2 years since I first saw you? I still remember, vividly, 2 years ago, from the moment I saw you smile, as you were walking out of the classroom and turned your head back, with the so
2016-04-28 18:43:51 1042
原创 北京林业大学“计蒜客”杯程序设计竞赛 网络赛 C-Candy【模拟】
There are NN children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:(1) Each child must have at least
2016-04-28 18:39:39 883
原创 北京林业大学“计蒜客”杯程序设计竞赛 网络赛 B-大钉骑马走江湖【bfs】
江湖是什么,对于在象棋界厮杀的大钉来说,江湖就是一个矩阵,他的目标,就是在江湖之中骑着马,从他的位置出发,走到终点。当然,大钉的马也遵从中国象棋中的“马走日”的规则,而且在矩阵中,也会有一些障碍物,马不能跳到障碍物上;如果大钉的马面前有障碍物,即被“别马腿”,那么他将不能跳向有障碍物的左前和右前这两个方向。请问最少需要多少步,大钉才能骑着马跳到终点。输入格式:有多组测试样例。每
2016-04-28 13:45:48 596
原创 北京林业大学“计蒜客”杯程序设计竞赛 网络赛 A-喝酒【模拟】
王大钉喜欢喝酒,存货都喝完了,他就去楼下买,正好楼下的商店为了响应学校的 ACM 校赛推出了优惠活动:凡是在本店买的啤酒,喝完以后 33 个空瓶可以换一瓶,44 个瓶盖也可以换一瓶酒。王大钉觉得太合算了,决定多买,现在他手里的钱可以买 NN 瓶酒,但是他算不出来,通过活动兑换他一共可以喝到多少瓶?他很难过,你能帮他计算一下他能喝的酒的数量吗?输入格式:输入第一行是一个正整数 TT,代表
2016-04-28 13:17:45 460
原创 ZOJ 3946-Highway Project【最短路的应用】(2016浙江省大学生程序设计竞赛)
Highway ProjectTime Limit: 2 Seconds Memory Limit: 65536 KB Edward, the emperor of the Marjar Empire, wants to build some bidirectional highways so that he can reach other cities from t
2016-04-27 19:29:00 818
原创 HDOJ 2097-Sky数【进制转换】
Sky数Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 20147 Accepted Submission(s): 11449Problem DescriptionSky从小喜欢奇特的东西,而且天生对数
2016-04-27 18:52:40 655
原创 HDOJ 1066-Last non-zero Digit in N!【阶乘最后非零解:模板】
Last non-zero Digit in N!Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7146 Accepted Submission(s): 1797Problem Description
2016-04-27 18:34:10 1393
原创 ZOJ 3947-Very Happy Great BG【模拟】(2016浙江省大学生程序设计竞赛)
Very Happy Great BGTime Limit: 2 Seconds Memory Limit: 65536 KB The summer training of ZJU ICPC in July is about to end. To celebrate this great and happy day, the coach of ZJU ICPC Tea
2016-04-26 19:34:07 785
原创 ZOJ 3938-Defuse the Bomb【模拟,题看着挺长】(2016浙江省大学生程序设计竞赛)
Defuse the BombTime Limit: 2 Seconds Memory Limit: 65536 KB The bomb is about to explode! Please defuse it as soon as possible! There is a display showing a number from 1 to 4 on the
2016-04-26 19:30:50 1352
原创 ZOJ 3936-Apples and Ideas【模拟】(2016浙江省大学生程序设计竞赛)
"If you have an apple and I have an apple and we exchange these apples then you and I will still each have one apple. But if you have an idea and I have an idea and we exchange these ideas, then each of us will have two ideas." - George Bernard ShawNow Al
2016-04-26 19:26:11 613
原创 POJ 1985-Cow Marathon【树的直径模板】
Cow MarathonTime Limit: 2000MS Memory Limit: 30000KTotal Submissions: 4583 Accepted: 2265Case Time Limit: 1000MSDescriptionAfter hearing about the epidemic
2016-04-26 19:04:09 351
原创 LightOJ 1094-1094 - Farthest Nodes in a Tree【树的直径模板】
1094 - Farthest Nodes in a Tree PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBGiven a tree (a connected graph with no cycles),
2016-04-26 12:36:14 430
原创 POJ 2891-Strange Way to Express Integers【中国剩余定理】
Strange Way to Express IntegersTime Limit: 1000MS Memory Limit: 131072KTotal Submissions: 12870 Accepted: 4102DescriptionElina is reading a book written by Ruji
2016-04-26 12:12:04 304
原创 HDOJ 5586-Sum【经典DP】
SumTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1318 Accepted Submission(s): 664Problem DescriptionThere is a number seque
2016-04-26 10:38:19 339
原创 HDOJ 5120-Intersection【几何数学】
IntersectionTime Limit: 4000/4000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 1857 Accepted Submission(s): 708Problem DescriptionMatt is a bi
2016-04-25 21:43:19 373
原创 ♥HDOJ 1271-整数对【数学】
整数对Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3120 Accepted Submission(s): 1102Problem DescriptionGardon和小希玩了一个游戏,Gardon
2016-04-25 19:28:27 527
原创 LightOJ 1019-Brush (V)【最短路,模板题】
Tanvir returned home from the contest and got angry after seeing his room dusty. Who likes to see a dusty room after a brain storming programming contest? After checking a bit he found that there is no brush in him room. So, he called Atiq to get a brush.
2016-04-25 19:23:56 414
原创 HDOJ 2063-过山车【匈牙利算法】
过山车Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 16978 Accepted Submission(s): 7406Problem DescriptionRPG girls今天和大家一起去游乐场玩
2016-04-25 17:36:14 409
原创 匈牙利算法
匈牙利算法是由匈牙利数学家Edmonds于1965年提出,因而得名。匈牙利算法是基于Hall定理中充分性证明的思想,它是部图匹配最常见的算法,该算法的核心就是寻找增广路径,它是一种用增广路径求二分图最大匹配的算法。-------等等,看得头大?那么请看下面的版本:通过数代人的努力,你终于赶上了剩男剩女的大潮,假设你是一位光荣的新世纪媒人,在你的手上有N个剩男,M个剩女,
2016-04-25 17:09:30 3852
原创 ZOJ 3944-People Counting【模拟】(2016浙江省大学生程序设计竞赛)
People CountingTime Limit: 2 Seconds Memory Limit: 65536 KB In a BG (dinner gathering) for ZJU ICPC team, the coaches wanted to count the number of people present at the BG. They did th
2016-04-24 17:49:59 826
原创 HDOJ 5463-Clarke and minecraft【贪心】
Clarke and minecraftTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 888 Accepted Submission(s): 445Problem DescriptionClarke
2016-04-24 17:22:03 381
原创 CodeForces 1A-Theatre Square【数学】
Theatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On the occasion of the city's anniversary, a decision was taken to pave the Square with square granite flagstones. Each flagstone is of the size a × a.What
2016-04-24 17:11:24 493
原创 ZZULIOJ 1822: 水水更健康
总所周知,zhourist是zufeoj的Rank2。他决定向Rank1发起进攻号角。于是他要刷爆oj,但是他平时忙于结交学妹,没有很多时间来做这些题,于是他想尽可能的做简单题来节省时间。所以他决定只做难度系数低于n的题。
2016-04-22 08:14:04 484
原创 poj 1182-食物链【并查集】
动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是"1 X Y",表示X和Y是同类。 第二种说法是"2 X Y",表示X吃Y。 此人对N个动物,用上述两种说法,一句接一句地说出K句话,这K句话有的是真的,有的是假的。当一句话满足下列三条之一时,这句话就是假话,否则就是真话。 1) 当前的话与
2016-04-21 22:22:43 260
原创 南京理工大学第八届程序设计大赛(校外镜像) J sequence
water1Time Limit: 1000MSMemory Limit: 65536KBDescription听说全球气候变暖,冰川融化,海水淹大地。着实好奇要融化多少冰川会淹没我的宿舍,哦不,淹没南京,反正NJUST应该总会是第一批被淹的。现将问题简化成一个二维坐标系的模型。有N个矩形块区域,每个区域有海拔(H)和宽度(W),区域按照顺序给出,比如有3个区域
2016-04-21 21:43:02 543
原创 南京理工大学第八届程序设计大赛(校外镜像) F sequence
将一个给定的数列,拆分成K个不降序列,每个数出现且只出现一次,且在各序列中各个数相对于原数列的相对顺序不变。如7 6 9 8 10可以拆成 7 9 10和6 8。求最小的K值。
2016-04-21 21:40:40 572
原创 STL vector用法介绍
介绍这篇文章的目的是为了介绍std::vector,如何恰当地使用它们的成员函数等操作。本文中还讨论了条件函数和函数指针在迭代算法中使用,如在remove_if()和for_each()中的使用。通过阅读这篇文章读者应该能够有效地使用vector容器,而且应该不会再去使用C类型的动态数组了。 Vector总览vector是C++标准模板库中的部分内容,它是一个多功能
2016-04-21 20:49:06 1396
原创 CodeForces 552B-Vanya and Books
B. Vanya and Bookstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVanya got an important task — he should e
2016-04-21 20:34:38 790
原创 CodeForces 552C-Vanya and Scales【思维】
C. Vanya and Scalestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVanya has a scales for weighing loads an
2016-04-21 20:31:07 556
原创 CodeForces 552D-Vanya and Triangles【计算整数三点能否组成三角形】
D. Vanya and Trianglestime limit per test4 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputVanya got bored and he painted n dis
2016-04-21 20:14:19 713
原创 CodeForces 552A-Vanya and Table【模拟】
Vanya has a table consisting of 100 rows, each row contains 100 cells. The rows are numbered by integers from 1 to 100 from bottom to top, the columns are numbered from 1 to 100 from left to right.In this table, Vanya chose n rectangles with sides that g
2016-04-21 20:10:00 285
原创 CodeForces 557B-Pasha and Tea【模拟】
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most ai milliliters of water.It turned out t
2016-04-21 20:07:30 443
原创 CodeForces 557A-Ilya and Diplomas【模拟】
Soon a school Olympiad in Informatics will be held in Berland, n schoolchildren will participate there.At a meeting of the jury of the Olympiad it was decided that each of the n participants, depending on the results, will get a diploma of the first, sec
2016-04-21 20:04:37 312
原创 CodeForces 554A-Kyoya and Photobooks【规律】
Kyoya Ootori is selling photobooks of the Ouran High School Host Club. He has 26 photos, labeled "a" to "z", and he has compiled them into a photo booklet with some photos in some order (possibly with some photos being duplicated). A photo booklet can be d
2016-04-21 19:53:54 529
原创 CodeForces 554B. Ohana Cleans Up【思维】
Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. Her broom is very strange: if she sweeps over a clean square,
2016-04-21 19:43:47 304
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人