- 博客(33)
- 收藏
- 关注
原创 nyoj 找球号(二)【位运算压缩,离散化处理】
找球号(二)时间限制:1000 ms | 内存限制:65535 KB难度:5描述在某一国度里流行着一种游戏。游戏规则为:现有一堆球中,每个球上都有一个整数编号i(0<=i<=100000000),编号可重复,还有一个空箱子,现在有两种动作:一种是"ADD",表示向空箱子里放m(0<m<=100)个球,另一种是"QUERY”,表示说出M(0<M<=100)个随机整
2015-11-28 15:59:33 509
原创 HDU 1394 Minimum Inversion Number【线段树,归并排序,树状数组】
Minimum Inversion NumberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15476 Accepted Submission(s): 9441Problem DescriptionThe
2015-11-27 22:27:39 325
原创 HDU 4548 美素数【素数打表】
美素数Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 4734 Accepted Submission(s): 1626Problem Description 小明对数的研究比较热爱,一谈到数,脑子里就涌现出
2015-11-24 22:26:59 372
原创 HDU 4339 Query【线段树】单点更新,动态查询
QueryTime Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 3010 Accepted Submission(s): 964Problem DescriptionYou are given two str
2015-11-24 17:34:48 444
原创 HDU 4027 Can you answer these queries?【线段树】区间开平方,区间求和
Can you answer these queries?Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 11061 Accepted Submission(s): 2583Problem Description
2015-11-21 19:50:02 396
原创 HDU 2795 Billboard【线段树】单点查找更新
BillboardTime Limit: 20000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 16533 Accepted Submission(s): 6993Problem DescriptionAt the entrance
2015-11-21 18:06:05 373
原创 HDU 1698 Just a Hook【线段树】区间修改,查询总和
Just a HookTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 24149 Accepted Submission(s): 12076Problem DescriptionIn the game of D
2015-11-19 21:45:04 373
原创 HDu 1556 Color the ball【线段树&&树状数组】区间更新,单点查询
Color the ballTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13670 Accepted Submission(s): 6867Problem DescriptionN个气球排成一排,从左到右依
2015-11-18 21:02:15 455
原创 UVA 11995 - I Can Guess the Data Structure!【stl】
原文网址:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3146挺恶心的一道题...需要判断多种状态,本来早写出来了,可是因为容器为空的时候,没特别注意,然后一re....其实自己也在猜测是不是这个原因..........
2015-11-17 20:49:09 455
原创 UVA 11991 - Easy Problem from Rujia Liu?【stl】
原文网址:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3142顺序给出n个数字和m次查询,查询时输入 k,v 输出从左到右第k个v 的下标,下标从1 到n。训练指南的一道题,也是感觉不好处理,有点麻烦,然后发现代码这么简
2015-11-17 15:57:29 373
原创 HDU 1559 最大子矩阵【最大子矩阵】
最大子矩阵Time Limit: 30000/10000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3614 Accepted Submission(s): 1833Problem Description给你一个m×n的整数矩阵,在上面找一个x×y
2015-11-15 17:06:06 708
原创 poj 3468 A Simple Problem with Integers【线段树】区间延迟,区间查询
A Simple Problem with IntegersTime Limit: 5000MS Memory Limit: 131072KTotal Submissions: 82019 Accepted: 25376Case Time Limit: 2000MSDescriptionYou have N
2015-11-15 12:38:11 326
原创 light oj 1082 - Array Queries【线段树】最简单的查询最值
1082 - Array QueriesPDF (English)StatisticsForumTime Limit: 3 second(s)Memory Limit: 64 MBGiven an array with N elements, indexed from 1 to N. Now you w
2015-11-14 13:07:00 467
原创 hdu 1754 I Hate It【线段树】 区间修改,最值查询
I Hate ItTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 54465 Accepted Submission(s): 21321Problem Description很多学校流行一种比较的习惯。老师
2015-11-13 22:22:04 582
原创 hdu 1166 敌兵布阵【线段树】单点更新,区间求和
敌兵布阵Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 63229 Accepted Submission(s): 26671Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国
2015-11-13 21:26:52 333
原创 UVa 10935 Throwing cards away I【队列模拟】
原文网址:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1876简单的队列模拟,结果pe了好久,无语,以后还是要耐心看题目要求啊...........#include#includeusing namespace st
2015-11-12 22:30:46 386
原创 nyoj 117 求逆序数【归并求逆序】
求逆序数时间限制:2000 ms | 内存限制:65535 KB难度:5描述在一个排列中,如果一对数的前后位置与大小顺序相反,即前面的数大于后面的数,那么它们就称为一个逆序。一个排列中逆序的总数就称为这个排列的逆序数。现在,给你一个N个元素的序列,请你判断出它的逆序数是多少。比如 1 3 2 的逆序数就是1。输入第一行输入一个
2015-11-12 20:02:53 536
原创 UVA 136 - Ugly Numbers【巧用优先队列】
Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ...shows the first 11 ugly numbers. By convention, 1 is included.Write a
2015-11-12 14:56:18 547
原创 nyoj 1119 士兵杀敌(三)【线段树】区间最值的差
士兵杀敌(三)时间限制:2000 ms | 内存限制:65535 KB难度:5描述南将军统率着N个士兵,士兵分别编号为1~N,南将军经常爱拿某一段编号内杀敌数最高的人与杀敌数最低的人进行比较,计算出两个人的杀敌数差值,用这种方法一方面能鼓舞杀敌数高的人,另一方面也算是批评杀敌数低的人,起到了很好的效果。所以,南将军经常问军师小工第i号士兵到第j号
2015-11-12 14:02:03 305
原创 nyoj 116 士兵杀敌(二)【线段树】区间求和
士兵杀敌(二)时间限制:1000 ms | 内存限制:65535 KB难度:5描述南将军手下有N个士兵,分别编号1到N,这些士兵的杀敌数都是已知的。小工是南将军手下的军师,南将军经常想知道第m号到第n号士兵的总杀敌数,请你帮助小工来回答南将军吧。南将军的某次询问之后士兵i可能又杀敌q人,之后南将军再询问的时候,需要考虑到新增的杀敌数。
2015-11-11 22:20:04 377
原创 nyoj 1185 最大最小值【线段树】
最大最小值时间限制:1000 ms | 内存限制:65535 KB难度:2描述给出N个整数,执行M次询问。对于每次询问,首先输入三个整数C、L、R: 如果C等于1,输出第L个数到第R个数之间的最小值; 如果C等于2,输出第L个数到第R个数之间的最大值; 如果C等于3,输出第L个数到第R个数之间的最小值与最大值的和
2015-11-10 20:57:57 443
原创 Hdu 5240 Exam【贪心】
DescriptionAs this term is going to end, DRD needs to prepare for his final exams. DRD has n exams. They are all hard, but their difficulties are different. DRD will spend at least ri hours
2015-11-08 13:24:16 634
原创 LightOJ 1354 - IP Checking【简单模拟】
DescriptionAn IP address is a 32 bit address formatted in the following waya.b.c.dwhere a, b, c, d are integers each ranging from 0 to 255. Now you are given two IP addresses, first one in dec
2015-11-08 13:19:03 463
原创 LightOJ 1297 Largest Box【简单计算几何】
DescriptionIn the following figure you can see a rectangular card. The width of the card is W and length of the card is L and thickness is zero. Four (x*x)squares are cut from the four corners of
2015-11-08 13:15:04 577
原创 LightOJ 1294 Positive Negative Sign【大水】
DescriptionGiven two integers: n and m and n is divisible by 2m, you have to write down the first n natural numbers in the following form. At first take first mintegers and make their sign negat
2015-11-08 13:09:20 365
原创 UVa 156 - Ananagrams【各种stl】
原题网址: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=835&page=show_problem&problem=92让输出整篇文章中,按字典序输出在字母的任意组合之后,在文章中仍然唯一的单词.想了很多方法去替代stl 但是实在不方便,就学着用stl了......
2015-11-08 13:06:23 339
原创 LightOJ 1245【数学】
DescriptionI was trying to solve problem '1234 - Harmonic Number', I wrote the following codelong long H( int n ) { long long res = 0; for( int i = 1; i n; i++ ) res = res
2015-11-07 20:00:21 626
原创 ny123 士兵杀敌(四)【线段树&&树状数组】
士兵杀敌(四)时间限制:2000 ms | 内存限制:65535 KB难度:5描述南将军麾下有百万精兵,现已知共有M个士兵,编号为1~M,每次有任务的时候,总会有一批编号连在一起人请战(编号相近的人经常在一块,相互之间比较熟悉),最终他们获得的军功,也将会平分到每个人身上,这样,有时候,计算他们中的哪一个人到底有多少军功就是一个比较困难的事情,军师小工的
2015-11-07 18:33:13 433
原创 1220 NUMBER BASE CONVERSION【高精度进制转化】
NUMBER BASE CONVERSIONTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 4909 Accepted: 2242DescriptionWrite a program to convert numbers in one base to
2015-11-05 16:30:01 480
原创 poj 1250&Toj 1932 Tanning Salon【巧妙模拟】
Tanning SalonTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 8063 Accepted: 4319DescriptionTan Your Hide, Inc., owns several coin-operated tanning sal
2015-11-03 16:52:05 446
原创 hdu 2579 Dating with girls(2)【bfs】
Dating with girls(2)Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2657 Accepted Submission(s): 741Problem DescriptionIf you hav
2015-11-01 15:41:30 349
原创 hdu 1495 非常可乐【bfs】
非常可乐Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7967 Accepted Submission(s): 3178Problem Description大家一定觉的运动以后喝可乐是一件很惬意的事情,但是
2015-11-01 15:36:26 363
原创 hdu 2803 The MAX【贪心】
The MAXTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2051 Accepted Submission(s): 888Problem DescriptionGiving N integers, V1,
2015-11-01 15:29:55 472
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人