- 博客(25)
- 问答 (8)
- 收藏
- 关注
原创 Ice Cave CodeForces - 540C
You play a computer game. Your character stands on some level of a multilevel ice cave. In order to move on forward, you need to descend one level lower and the only way to do this is to fall through
2017-09-20 23:40:10 277
原创 Balls and Boxes CodeForces - 260C
C. Balls and Boxestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Vasya had n boxes with balls in the room. Th
2017-09-20 23:35:35 309
转载 Dollar Dayz POJ - 3181
点击打开链接 Farmer John goes to Dollar Days at The Cow Store and discovers an unlimited number of tools on sale. During his first visit, the tools are selling variously for $1, $2, and $3. Farmer Joh
2017-09-19 23:02:58 240
原创 Proud Merchants HDU - 3466
点击打开链接Recently, iSea went to an ancient country. For such a long time, it was the most wealthy and powerful kingdom in the world. As a result, the people in this country are still very proud even
2017-09-18 23:55:18 321
原创 Cyclic Nacklace HDU - 3746
CC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are only 99.9 yuan left. he is too distressed and thinking about how to...
2017-09-18 23:51:32 347
原创 New Year and Rating CodeForces - 750C
点击打开链接Every Codeforces user has rating, described with one integer, possibly negative or zero. Users are divided into two divisions. The first division is for users with rating1900 or higher.
2017-09-17 22:56:30 148
原创 Taxes CodeForces - 735D
Mr. Funt now lives in a country with a very specific tax laws. The total income of mr. Funt during this year is equal ton (n ≥ 2) burles and the amount of tax he has to pay is calculated as the maxi
2017-09-16 20:15:23 195
原创 Fountains CodeForces - 799C
Arkady plays Gardenscapes a lot. Arkady wants to build two new fountains. There aren available fountains, for each fountain its beauty and cost are known. There are two types of money in the game: c
2017-09-16 19:40:26 251
原创 地铁修建 CCF
问题描述 A市有n个交通枢纽,其中1号和n号非常重要,为了加强运输能力,A市决定在1号到n号枢纽间修建一条地铁。 地铁由很多段隧道组成,每段隧道连接两个交通枢纽。经过勘探,有m段隧道作为候选,两个交通枢纽之间最多只有一条候选的隧道,没有隧道两端连接着同一个交通枢纽。 现在有n家隧道施工的公司,每段候选的隧道只能由一个公司施工,每家公司施工需要的天数一致。而每家公司最多只能修建一条
2017-09-16 19:35:43 286
转载 vector中erase用法注意事项
以前就发现了vector中的erase方法有些诡异(^_^),稍不注意,就会出错。今天又一次遇到了,就索性总结一下,尤其是在循环体中用erase时,由于vector.begin() 和vector.end()是变化的,因此就引入了错误的可能性。erase的函数原型有两种形式:iterator erase(iterator position);iterator erase(itera
2017-09-10 20:28:10 352
原创 Tennis Championship CodeForces - 735C
Famous Brazil city Rio de Janeiro holds a tennis tournament and Ostap Bender doesn't want to miss this event. There will ben players participating, and the tournament will follow knockout rules from
2017-09-07 23:38:26 196
原创 24 Game CodeForces - 468A
Little X used to play a card game called "24 Game", but recently he has found it too easy. So he invented a new game.Initially you have a sequence of n integers:1, 2, ..., n. In a single step, you
2017-09-07 23:25:28 285
原创 选择子序列 51Nod - 1153
长度为N的整数数组A,所有的数均不相同,假设下标从0开始。找到一个最长的数组B,B数组的长度为K,数值范围是0 - N - 1,记录的是A数组的下标。满足AB[0] > AB[1] > AB[2] >...AB[K],并且对任意连续的两项Bi及Bi+1,满足min(Bi,Bi+1) i,Bi+1) 均有Aj B[i+1] ,求最大的K。例如:9, 10, 2, -1
2017-09-07 23:16:29 261
原创 猜数字 HDU - 1172
猜数字游戏是gameboy最喜欢的游戏之一。游戏的规则是这样的:计算机随机产生一个四位数,然后玩家猜这个四位数是什么。每猜一个数,计算机都会告诉玩家猜对几个数字,其中有几个数字在正确的位置上。比如计算机随机产生的数字为1122。如果玩家猜1234,因为1,2这两个数字同时存在于这两个数中,而且1在这两个数中的位置是相同的,所以计算机会告诉玩家猜对了2个数字,其中一个在正确的位置。如果玩家猜
2017-09-07 23:13:50 148
原创 New Year and North Pole CodeForces - 750B
In this problem we assume the Earth to be a completely round ball and its surface a perfect sphere. The length of the equator and any meridian is considered to be exactly40 000 kilometers. Thus, tra
2017-09-07 23:10:39 275
原创 New Year and Rating CodeForces - 750C
Every Codeforces user has rating, described with one integer, possibly negative or zero. Users are divided into two divisions. The first division is for users with rating1900 or higher. Those with r
2017-09-07 22:47:47 211
原创 Codeforces Round #432 B. Arpa and an exam about geometry
B. Arpa and an exam about geometrytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputArpa is taking a geometry exam. He
2017-09-05 10:01:08 226
转载 字符串匹配的KMP算法
字符串匹配是计算机的基本任务之一。 举例来说,有一个字符串"BBC ABCDAB ABCDABCDABDE",我想知道,里面是否包含另一个字符串"ABCDABD"? 许多算法可以完成这个任务,Knuth-Morris-Pratt算法(简称KMP)是最常用的之一。它以三个发明者命名,起头的那个K就是著名科学家Donald Knuth。 下面,我用自己的语言,试图写一篇比...
2017-09-03 23:42:24 210
原创 Subway
You have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of getting to ride your bike to school every day, you now get to walk and take the subway. Because you don't want
2017-09-01 23:32:56 190
原创 Invitation Cards
In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique Comedies. They
2017-09-01 23:29:04 257
原创 Cow Contest
N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certain constant skill rating that is un
2017-09-01 23:25:29 865 3
原创 Wormholes
点击打开链接While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a ti...
2017-09-01 22:54:41 971
原创 最大子矩阵
给你一个m×n的整数矩阵,在上面找一个x×y的子矩阵,使子矩阵中所有元素的和最大。 Input 输入数据的第一行为一个正整数T,表示有T组测试数据。每一组测试数据的第一行为四个正整数m,n,x,y(0<m,n<1000 AND 0<x<=m AND 0<y<=n),表示给定的矩形有m行n列。接下来这个矩阵,有m行,每行有n个不大于1000的正整数。Output 对于每组数据,输出一个整数,
2017-09-01 22:50:43 237
原创 最大连续子序列
给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ...,Nj },其中 1 例如给定序列{ -2, 11, -4, 13, -5, -2 },其最大连续子序列为{ 11, -4, 13 },最大和 为20。 在今年的数据结构考卷中,要求编写程序得到最大和,现在增加一个要求,即还需要输出该 子序列的第一个和最后一个元素。
2017-09-01 22:48:46 220
原创 Alice, Bob and Chocolate CodeForces - 6C
Alice and Bob like games. And now they are ready to start a new game. They have placedn chocolate bars in a line. Alice starts to eat chocolate bars one by one from left to right, and Bob — from rig
2017-09-01 22:29:56 292
空空如也
希望大神解答一下,这道题用bfs+优先队列为什么不对,只能用最短路径来写
2017-08-02
c语言中指针,希望大神解答
2017-04-08
C++ 中的析构函数,望大神解答
2017-03-28
找出语句中中最长的单词
2017-03-07
希望大神指点,十分感谢
2017-03-07
c语言编程中的问题,希望大神指点
2017-03-06
c语言计算三角形面积,存在不懂知识
2016-10-19
关于c语言学习中存在的问题
2016-10-19
TA创建的收藏夹 TA关注的收藏夹
TA关注的人