- 博客(249)
- 收藏
- 关注
原创 hihoCoder 1261 String Problem II
时间限制:50000ms单点时限:5000ms内存限制:512MB描述我们有一个字符串集合S,其中有N个两两不同的字符串。还有M个询问,每个询问都会先给出一个字符串w,你需要回答以下三个问题:1. 输出所有S的串中,可以由w恰好添加两个字符得到的串中,编号最小的3个。2. 输出所有S的串中,可以由w修改不超过2个字符得到的串中,编号最小的3个。3
2015-12-27 22:16:56 1437
原创 hihoCoder 1260 String Problem I
时间限制:10000ms单点时限:1000ms内存限制:256MB描述我们有一个字符串集合S,其中有N个两两不同的字符串。还有M个询问,每个询问给出一个字符串w,求有多少S中的字符串可以由w添加恰好一个字母得到。字母可以添加在包括开头结尾在内的任意位置,比如在"abc"中添加"x",就可能得到"xabc", "axbc", "abxc", "abcx
2015-12-27 22:06:49 1695
原创 605B. Lazy Student(codeforces Round 335)
B. Lazy Studenttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputStudent Vladislav came to his programming e
2015-12-10 17:15:40 1806
原创 51nod 1394 差和问题(算法马拉松8)
有一个集合S,初始状态下有n个元素,对他进行如下操作:1、向S里面添加一个值为v的元素。输入格式为1 v2、向S里面删除一个值为v的元素。输入格式为2 v3、询问S里面的元素两两之差绝对值之和。输入格式为3 对于样例,操作3,|1-2|+|1-3|+|2-3|=4操作1 4之后,集合中的数字为1 2 3 4操作3,|1-2|+|1-3
2015-11-30 16:05:02 2295
原创 hackerrank Week of Code Target
Problem StatementLet's consider a standard darts target that consists of K concentric circles with the corresponding radiuses R1,R2,...,RK with the common center in the origin (0,0).
2015-11-30 13:58:41 2003
原创 HackerRank Week of Code -18 GG
Problem StatementYou are given an integer, N and a string, S of the length N−1 consisting of the letters 'G' and 'L'.A permutation P of the integers from 0 to (N−1) satisfies the p
2015-11-30 13:38:01 1694
原创 ubuntu 下安装bochs
参考文章:http://blog.csdn.net/lilongherolilong/article/details/7683952 安装gcc编译环境 sudo apt-get install build-essential sudo apt-get install xorg-dev sudo apt-get install libgtk2.0-d
2015-11-09 17:22:31 2983
原创 hihoCoder 1236 Scores(2015北京赛区网络赛)
时间限制:4000ms单点时限:4000ms内存限制:256MB描述Kyle is a student of Programming Monkey Elementary School. Just as others, he is deeply concerned with his grades.Last month, the school held an
2015-10-13 12:17:51 1593
原创 zoj 3913 Bob wants to pour water(zoj 2015年10月月赛k题)
Bob wants to pour waterTime Limit: 2 Seconds Memory Limit: 65536 KB Special JudgeThere is a huge cubiod house with infinite height. And there are some spheres and some cuboids in the
2015-10-11 17:53:44 2947
原创 zoj 3908 Number Game(zoj 2015年10月月赛F题)
Number GameTime Limit: 2 Seconds Memory Limit: 65536 KBThe bored Bob is playing a number game. In the beginning, there are n numbers. For each turn, Bob will take out two numbers from the
2015-10-11 17:41:37 4979
原创 hdu 5036 Explosion(有向图的删点期望+bitset优化)
Explosion Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)
2015-10-10 19:03:41 3762
原创 hdu 5486 Difference of Clustering(合肥网赛)
Difference of Clustering Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
2015-09-27 19:43:44 4795
原创 hdu 5451 Best Solver(2015沈阳赛区网赛)
Best Solver Time Limit: 1500/1000 MS (Java/Others) Memory Limit: 65535/102400 K (Java/Others)
2015-09-19 18:36:19 6287
原创 578C. Weakness and Poorness(Codeforces Round #320)
C. Weakness and Poornesstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a sequence of n inte
2015-09-17 09:20:21 3824
原创 51nod 1225 余数之和
题目:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1225F(n) = (n % 1) + (n % 2) + (n % 3) + ...... (n % n)。其中%表示Mod,也就是余数。 例如F(6) = 6 % 1 + 6 % 2 + 6 % 3 + 6 % 4 + 6 % 5 +
2015-09-07 19:22:33 6540
原创 51nod 1201 整数划分(锻炼思维的好题)
题目:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1201将N分为若干个不同整数的和,有多少种不同的划分方式,例如:n = 6,{6} {1,5} {2,4} {1,2,3},共4种。由于数据较大,输出Mod 10^9 + 7的结果即可。Input输入1个数N(1 Out
2015-09-03 22:48:19 5150 3
原创 51nod 1241 特殊的排序(锻炼思维的好题)
题目:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1241一个数组的元素为1至N的整数,现在要对这个数组进行排序,在排序时只能将元素放在数组的头部或尾部,问至少需要移动多少个数字,才能完成整个排序过程?例如:2 5 3 4 1 将1移到头部 => 1 2 5 3 4 将5移到尾部
2015-09-03 22:16:30 4426
原创 51nod 1276 岛屿的数量(锻炼思维的好题)
有N个岛连在一起形成了一个大的岛屿,如果海平面上升超过某些岛的高度时,则这个岛会被淹没。原本的大岛屿则会分为多个小岛屿,如果海平面一直上升,则所有岛都会被淹没在水下。给出N个岛的高度。然后有Q个查询,每个查询给出一个海平面的高度H,问当海平面高度达到H时,海上共有多少个岛屿。例如:岛屿的高度为:{2, 1, 3, 2, 3}, 查询为:{0, 1, 3, 2}。当海面高度为0时,所有的
2015-09-01 20:57:31 4549
原创 51nod 1243 排船的问题(锻炼思维的好题)
一个码头中有N艘船和N个木桩,船的长度为2*X,码头的宽度为M,N个木桩的位置(相对码头左岸的位置)会在数据中给出。船和船之间不能重叠,即每艘船的船头不能超过上一艘船的船尾,当然也不能超出码头的两岸。船和木桩之间用绳子连接,并且1个木桩只能栓1条船,绳子的一头拴在木桩上,另一头拴在船的中间。而船中间到木桩的距离,就是所需的绳子的长度。由你根据给出的条件,排列船的位置,使得所用到的最长的绳子最短。输
2015-08-31 18:58:56 3863
原创 51nod 1287 加农炮(锻炼思维的好题)
题目:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1287一个长度为M的正整数数组A,表示从左向右的地形高度。测试一种加农炮,炮弹平行于地面从左向右飞行,高度为H,如果某处地形的高度大于等于炮弹飞行的高度H(A[i] >= H),炮弹会被挡住并落在i - 1处,则A[i - 1] + 1。如果H
2015-08-30 14:37:48 4305
原创 573B. Bear and Blocks(Codeforces Round #318)
B. Bear and Blockstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLimak is a little bear who loves to play.
2015-08-30 03:36:45 5003
原创 51nod 1391 01串(锻炼思维的好题)
题目http://www.51nod.com/onlineJudge/questionCode.html#problemId=1391¬iceId=209171391 01串题目来源: Codility基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题给定一个01串S,求出它的一个尽可能
2015-08-26 18:41:23 4708
原创 571B. Minimization(Codeforces Round #317)
B. Minimizationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou've got array A, consisting of n integer
2015-08-23 09:55:50 4807 2
原创 51nod Bash游戏(V1,V2,V3,V4(斐波那契博弈))
Bash游戏V1有一堆石子共有N个。A B两个人轮流拿,A先拿。每次最少拿1颗,最多拿K颗,拿到最后1颗石子的人获胜。假设A B都非常聪明,拿石子的过程中不会出现失误。给出N和K,问最后谁能赢得比赛。例如N = 3,K = 2。无论A如何拿,B都可以拿到最后1颗石子。Input第1行:一个数T,表示后面用作输入测试的数的数量。(1 <=
2015-08-21 22:31:49 5409
原创 hdu 5414 CRB and String(2015 Multi-University Training Contest 10)
CRB and String Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
2015-08-20 18:31:24 3926
原创 hdu 5416 CRB and Tree(2015 Multi-University Training Contest 10)
CRB and Tree Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
2015-08-20 18:17:42 2882
原创 Codeforces Round #316 (Div. 2)
A题题目大意: 一个城市有m个城市,每个城市先投票选出一个候选人,得票多的胜出,得票相同时,下标小的胜出,接着在城市选出的候选人中选出一个胜者。解题思路: 按照题意模拟就好了。代码:#include #include #include #include using namespace std;const int m
2015-08-14 09:43:21 3928
原创 hdu 5360 Hiking(2015 Multi-University Training Contest 6)
Hiking Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)
2015-08-06 19:19:25 5486
原创 hdu 5353 Average(2015 Multi-University Training Contest 6)
Average Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)
2015-08-06 18:42:47 4056
原创 Codeforces Round #Pi (Div. 2)
A题 题目大意: 给出一个数组,找每个位置的与序列里的其他值的差的绝对值最大值与最小值。解题思路: 记录位置并排序,最大值肯定与排序后的头元素或尾元素的差,最小值肯定是排序后的位置的前一个元素或者后一个元素。代码:#include #include #include #include using namespace std;cons
2015-08-06 11:58:43 3519
原创 hdu 5335 Walk Out (2015 Multi-University Training Contest 4)
Walk Out Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
2015-07-30 18:31:59 4466
原创 hdu 5316 Magician(2015 Multi-University Training Contest 3)
Magician Time Limit: 18000/9000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
2015-07-28 19:43:50 781
原创 zoj 3890 Wumpus(zoj 2015年7月月赛)
WumpusTime Limit: 2 Seconds Memory Limit: 65536 KBOne day Leon finds a very classic game called Wumpus.The game is as follow.Once an agent fell into a cave. The legend said that in this
2015-07-28 09:34:22 4598
原创 zoj 3888 Twelves Monkeys(zoj 2015年7月月赛)
Twelves MonkeysTime Limit: 5 Seconds Memory Limit: 32768 KBJames Cole is a convicted criminal living beneath a post-apocalyptic Philadelphia. Many years ago, the Earth's surface had been
2015-07-28 09:17:21 726
原创 zoj 3882 Help Bob(zoj 2015年7月月赛)
Help BobTime Limit: 2 Seconds Memory Limit: 65536 KBThere is a game very popular in ZJU at present, Bob didn't meant to participate in it. But he decided to join it after discovering a lo
2015-07-28 09:00:08 4564
原创 hdu 5308 I Wanna Become A 24-Point Master(2015 Multi-University Training Contest 2)
I Wanna Become A 24-Point Master Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
2015-07-24 09:26:47 2784
原创 hdu 5303 Delicious Apples(2015 Multi-University Training Contest 2)
Delicious Apples Time Limit: 5000/3000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)
2015-07-24 09:16:31 4068
原创 Codeforces Round 313(div1)
A题: 题目大意: 给出内角全为120度的六边形的六条边的边长,求由多少边长为1的等边三角形构成。解题思路: 将六边形补全为一个大的等边三角形,则大的等边三角形的边长为六边形的相邻三边之和,接着减去补的部分,补的部分是三个边长为认识3个不相邻的六边形边长的长度构成的等边三角形,边长为a的等边三角形,由a*a个边长为1的小三角形构成。
2015-07-23 11:42:56 5437
原创 hdu 5289 Assignment(2015 Multi-University Training Contest 1)
Assignment Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
2015-07-22 11:36:23 3975
原创 hdu 5288 OO’s Sequence(2015 Multi-University Training Contest 1)
OO’s Sequence Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)
2015-07-22 11:15:28 3785
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人