
NOJ
文章平均质量分 71
tokers
所有的魅力在“习惯”面前都将无色。
展开
-
Good Bye 2015 (One University One Question) Round III
A. Red packet题意: nn个人分mm元的红包,然后告诉你kk个人获得的红包大小,问你如果你想成为手气王(钱拿的最多),至少需要得到多大的红包,或者输出”Impossible”,如果不可能的话,注意红包必须分完,并且每个人获得的红包大小都是整数(>0)(> 0)分析: 首先可以得到kk个人里的最大值MM,设现在剩下的钱是RR,那么首先要成为手气王,就必须得到至少M+1M+1,但是最多是原创 2016-02-07 13:58:35 · 1217 阅读 · 0 评论 -
nbut线段树专题C - Mayor\'s posters
DescriptionThe citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council ha原创 2014-08-05 10:42:52 · 642 阅读 · 0 评论 -
NBUT-2014暑期集训专题练习1 -> 二分法 A题
DescriptionIgnatius bought a land last week, but he didn't know the area of the land because the land is enclosed by a parabola and a straight line. The picture below shows the area. Now given all the原创 2014-08-05 10:42:29 · 685 阅读 · 0 评论 -
NOJ [1289] Will TT Get Snacks?
问题描述Mr. Cai and TT were playing in a beautiful sandy beach, and TT discovered a tree branch with many ant walking on it.TT noticed that when one ant meet another, they would turn back and keep on walk原创 2014-08-05 10:42:11 · 584 阅读 · 0 评论 -
NOJ [1116] Flandre\'s Passageway
http://blog.youkuaiyun.com/code_tank/article/details/31756211在另一个博客上的我的题解原创 2014-08-05 10:41:50 · 490 阅读 · 0 评论 -
NOJ1538——[1538] K-Submartix
问题描述You are given a matrix consisting of some integer, its size is n*m.You should find a minimum area submatrix that the sum of the submatrix (sum of all elements in the submatrix) is not less k.输入The原创 2014-08-05 10:45:29 · 704 阅读 · 0 评论 -
nbut线段树专题I - Balanced Lineup
DescriptionFor the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows. To k原创 2014-08-05 10:42:50 · 532 阅读 · 0 评论 -
NBUT-2014暑期集训专题练习1 -> 二分法 J - J
DescriptionMy birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party a原创 2014-08-05 10:42:34 · 578 阅读 · 0 评论 -
NOJ [1148] Creating Palindrome
问题描述XadillaX likes to play with strings very much.His favorite string is palindrome. Once he come across with a string, XadillaX always wants to change it to a palindrome by resorting the letters.Now原创 2014-08-05 10:42:13 · 497 阅读 · 0 评论 -
NOJ [1173] Birdlike Angry Pig
问题描述There's no end to revenge.Pigs like to eat birds' eggs, so birds decide to revenge.For this, pigs decide to revenge as well.Pigs give a task to a birdlike pig. They let he sneak into the birds gro原创 2014-08-05 10:42:06 · 522 阅读 · 0 评论 -
NOJ [1269] Kha\'Zix\'s Skull
水题一枚,只是很久没练习背包了,偶尔练练问题描述Kha'Zix and Rengar are a pair of enemies.Rengar can collect a Kha'Zix' Skull after he killed him.But you know, every game may appear a Kha'Zix. So Rengar may collect lots of sk原创 2014-08-05 10:41:57 · 892 阅读 · 0 评论 -
NOJ [1002] 将军问题
问题描述关于中国象棋,想必大家都很熟悉吧。我们知道,在走棋的时候,被对方將军的这种情形是很容易被人察觉的(不然,你也太粗心了)。但是我们的计算机是如何识别这种情形的呢?它显然没有人的这种“直觉”。这就是我们今天要解决的问题,你的任务就是写一段计算机代码,根据当前局面信息,判断是否存在一方正在被另一方將军的情形,并给出正确结果。图片一如图一,象棋棋盘由九条竖线和十条横线交叉组成。棋盘上共有九十个交叉原创 2014-08-05 10:41:45 · 951 阅读 · 0 评论 -
NOJ——[1176] Exchange Rate
问题描述 You know, every country's currency has an exchange rate to another country.For example, 'Dollir' : 'RNB' is 1 : 6.And exchanging from one currency to another curren原创 2014-08-05 10:45:42 · 803 阅读 · 0 评论 -
NOJ——[1480] 懒惰的风纪委Elaine
问题描述 Elaine是学园都市中的一个风纪委,每天都会接到命令对某个街道进行检查,并抓捕危险分子。她所在的风纪委支部附近有M条街道。这些街道由北到南并排均匀的分布在一条直线上,每条街道之间的距离都为1。但是众所周知,Elaine是一个很懒很懒的人(-..-说我坏话!!被我看到了!!),她不想一步一步走完所有街道,但好在她的好友K原创 2014-08-05 10:45:35 · 1982 阅读 · 0 评论 -
NOJ——[1438] Get Up, Soldier!
问题描述小日本真是越来越嚣张了,不过我军也不是吃素的。为了能够痛击小日本,我军决定近日举行一个军事演习,演戏的方式是红蓝两军在长城两侧对峙,双方都想要拿下对方阵地。目前双方正僵持在长城上。作为蓝军司令,你迫切想要知道长城上的战况。为简单起见,假设长城是一维的,坐标从1到n。你的部下每一次都会送来一个情报:从X到Y位置的战况被逆转了。这个逆转的意思就是,假如这个位置本是蓝军占领,那么现在被红军占领了原创 2014-08-05 10:44:14 · 646 阅读 · 0 评论 -
NBUT Summer Contest-1题解报告
[A] 走走走走走啊走再水不过的dp了,不过要注意一些细节,每个点可正可负,可选可不选。状态方程是 t=max(dp[i][j-1],dp[i-1][j]),dp[i][j]=max(t+mat[i][j],t),初始化的时候,dp[0][0]也要选择大的,就因为开始没注意这个,wa了好多次。#include#include#include#include#include#include#i原创 2014-08-05 10:43:29 · 488 阅读 · 0 评论 -
NBUT 动态规划专题——A - Gangsters
DescriptionN gangsters are going to a restaurant. The i-th gangster comes at the time Ti and has the prosperity Pi. The door of the restaurant has K+1 states of openness expressed by the integers in t原创 2014-08-05 10:43:24 · 525 阅读 · 0 评论 -
NBUT动态规划专题——D - The more, The Better
DescriptionACboy很喜欢玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏中ACboy允许攻克M个城堡并获得里面的宝物。但由于地理位置原因,有些城堡不能直接攻克,要攻克这些城堡必须先攻克其他某一个特定的城堡。你能帮ACboy算出要获得尽量多的宝物应该攻克哪M个城堡吗? Input每个测试实例首先包括2个整数,N,M.(1 = 0。当N = 0, M = 0原创 2014-08-05 10:43:17 · 615 阅读 · 0 评论 -
NBUT Summer Contest-2 题解报告
[A] 想减肥的字符串问题描述从前,有一串很长很长的字符串,它由n个小写字母组成。有一天它在照镜子的时候,觉得自己太肥了,于是它想减肥。减肥的时候,可以不断地去掉第一个或者最后一个字符。它希望自己减肥之后,对于小写字母a、b、c,自己身上都至少保留有一个。它想知道自己减肥后的最小长度,你能帮帮它吗?输入每行有一串由小写字母组成的字符串,字符串的长度n 输出每行输出一个数字,表示该组数据求得的最小长原创 2014-08-05 10:43:36 · 724 阅读 · 0 评论 -
NOJ——[1372] Do What
问题描述There are n numbers of business, different business will cost you different times. But you need not to finish all of them, just it is ok when you finish some of them that you spend more than T min原创 2014-08-05 10:44:51 · 508 阅读 · 0 评论 -
NOJ1175---Dress, Left Dress!(单调栈)
Maybe you think this problem is about girls and ladies. But you’re wrong. ‘Left dress’ means ‘Eyes left’. It’s used in armed forces. It will make a square more orderly. Now several soldiers stand in原创 2015-05-07 18:19:37 · 745 阅读 · 0 评论 -
NOJ1553---Beautiful Walls(尺取法)
问题描述 To simplify the building process, XadillaX built some template on the ground. The template is a very big wall and the height of each unit may be different.8Mao and Hungar have to choose any part原创 2015-04-16 20:22:53 · 737 阅读 · 0 评论 -
NOJ1560---Let Slimes Grow Up(线段树)
问题描述 You know 8Mao has his own Slime Team. But he soon found that let the Slimes stand in a line and make them from low to high is a such stupid thing since the Slimes are so f[bi][bi]king stupid! As原创 2015-04-16 21:05:31 · 751 阅读 · 0 评论 -
NOJ1222-English Game(AC自动机+dp)
问题描述This English game is a simple English words connection game.The rules are as follows: there are N English words in a dictionary, and every word has its own weight v. There is a weight if the corre原创 2015-04-16 12:49:06 · 776 阅读 · 0 评论 -
NOJ1545---New Year 2014(数位dp)
问题描述In the New Year 2014, Xiao Ming is thinking about the question: give two integers N and K, Calculate the number of the numbers of satisfy the following conditions:It is a positive integer and is n原创 2015-04-14 15:50:29 · 693 阅读 · 0 评论 -
NOJ1009——连连看
[1009] 连连看时间限制: 1000 ms 内存限制: 65535 K 问题描述大家都知道一个曾经风靡一时的游戏:连连看。 XadillaX在做连连看的时候不专心,做做就去玩别的去了,但他想早点完成这个小游戏,于是他找到你来帮他完成连连看的一段核心代码。 首先会给出一副连连看的分布图形,然后会给你各种鼠标点击操作(鼠标点击的坐标),你的工作就是算出最后还剩下几个方块。 鼠标操作之后原创 2014-09-25 13:06:19 · 825 阅读 · 0 评论 -
NOJ1589——[1589] 老蔡和TT
问题描述老蔡和TT常常约会,他们的约会地点有n个,其中有一些约会地点是相通的,例如地点a到地点b之间有一条路,说明a可以到b,但b不能到a,有一天老菜在思考,怎样才能让这些地点都相互可达呢?因为TT前一刻喜欢在这里,下一刻就想到其他地方了,为了满足TT的愿望,老蔡向你求助,你能帮助他求出他最少要造的路吗?输入第一行包含2个整数,n,m (0接下来的m行,每行2个整数a和b,原创 2014-08-18 23:05:54 · 701 阅读 · 0 评论 -
NOJ1437——[1437] Shutdown
问题描述某部队进行新兵队列训练,将新兵从一开始按顺序依次编号,并排成一行横队,训练的规则如下:从头开始一至二报数,凡报到二的出列,剩下的向小序号方向靠拢,再从头开始进行一至三报数,凡报到三的出列,剩下的向小序号方向靠拢,继续从头开始进行一至二报数。。。,以后从头开始轮流进行一至二报数、一至三报数直到剩下的人数不超过三人为止。输入本题有多个测试数据组,第一行为组数N,接着为N原创 2014-08-17 22:57:31 · 770 阅读 · 0 评论 -
NOJ[1508] 火烧赤壁2
时间限制: 1000 ms 内存限制: 65535 K 问题描述上次出了一道火烧赤壁的题目给当时的新生,也就是你们的上一届学长们做,那么这次,我又想到了另一个想法。上次的火烧赤壁的题号为1274这次稍微难一点,我们来个火烧赤壁2吧。Hungar个人很喜欢曹操这个人,所以这次有机会穿越到三国时代,他想帮助曹操打赢赤壁之战。但是他去晚了,当他穿越到那的时候发现大火已经在蔓延了,原创 2014-08-14 21:41:33 · 1260 阅读 · 0 评论 -
NOJ[1329] Last Battle
[1329] Last Battle时间限制: 1000 ms 内存限制: 65535 K 问题描述TT and her army exterminated the big boss and his demons successfully, but TT's army suffered great losses. they met the final boss, what? anoth原创 2014-08-11 16:46:23 · 531 阅读 · 0 评论 -
NOJ[1159] Taxi Cab Scheme
问题描述Running a taxi station is not all that simple. Apart from the obvious demand for a centralised coordination of the cabs in order to pick up the customers calling to get a cab as soon as possib原创 2014-08-07 17:47:25 · 653 阅读 · 0 评论 -
NOJ[1161] Card Game Cheater
问题描述Adam and Eve play a card game using a regular deck of 52 cards. The rules are simple. The players sit on opposite sides of a table, facing each other. Each player gets k cards from the deck an原创 2014-08-06 17:30:41 · 978 阅读 · 0 评论 -
NOJ——[1579] 小青蛙找妈妈
时间限制: 1000 ms 内存限制: 65535 K 问题描述 小青蛙和他的妈妈走散了,怎么办呢?小青蛙好着急阿,他就在荷叶上跳来跳去找他的妈妈呀,妈妈,妈妈,你在哪儿?妈妈说,我在这儿呀。你快过来。小青蛙太小了,他的弹跳能力实在太低了,我们必须找到一条路,让他能够最轻松跳过去。妈妈在位置1 ,而小青蛙在位置2.青蛙只原创 2014-08-05 10:45:49 · 1195 阅读 · 0 评论 -
NOJ——[1378] 战斗吧!皇后们!
时间限制: 1000 ms 内存限制: 65535 K 问题描述 我们都知道N皇后问题吧(ACM超级经典的题目,不知道的话 在我们oj找找看吧)!现在我们简单一下问题,只要两个皇后,而且我们还要这两个皇后斗争吧~2012都过去了,让我们决一死战吧~ 输入原创 2014-08-05 10:45:40 · 1071 阅读 · 0 评论 -
NOJ——[1143] Irrigation of Farmland
问题描述 Hungar has bought some farms.There is a river near the farm. It was found that linking these farms is more conducive for hungar. Therefore, he need to calculate tha原创 2014-08-05 10:45:38 · 582 阅读 · 0 评论 -
NOJ1383——[1383] Palindrome String
问题描述 给定一组字符串长度不大于1000,字符范围a~z。 从这个字符串中取出K个字符,在这些字符相对位置不变的情况下能够组成一个回文串,求K的最大值。 例如,对于字符串:abcda。 我取k=3,我可以取abcda中的第一个第三个第五个字符组成新的字符串aca,他是一个回文串。 所谓回文串,就是这个字符串是根原创 2014-08-05 10:45:33 · 634 阅读 · 0 评论 -
NBUT 动态规划专题C - 滑雪
DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 3 4 5 16 17 18 19 6 15 24 25 20 7 14 23 22 21 8原创 2014-08-05 10:43:20 · 579 阅读 · 0 评论 -
NBUT-2014暑期集训专题练习1 -> 二分法 N - N
DescriptionRecently your team noticed that the computer you use to practice for programming contests is not good enough anymore. Therefore, you decide to buy a new computer.To make the ideal computer原创 2014-08-05 10:43:11 · 670 阅读 · 0 评论 -
nbut线段树专题A - Count the Colors
DescriptionPainting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones.Your task is counting the segments of different colors you can see at l原创 2014-08-05 10:43:04 · 585 阅读 · 0 评论 -
NBUT-2014暑期集训专题练习1 -> 二分法 H - H
DescriptionIn the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn ? 1 + Fn ? 2 for n ≥ 2. For example, the first ten terms of the Fibonacci sequence are:0, 1, 1, 2, 3, 5, 8, 13, 21, 34, …An al原创 2014-08-05 10:42:36 · 582 阅读 · 0 评论