HDUOJ
Sureina
空太はバカ
展开
-
HDU 1166 - 敌兵布阵
Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。原创 2017-03-04 10:49:10 · 605 阅读 · 0 评论 -
HDU 5724 - Chess
Problem DescriptionAlice and Bob are playing a special chess game on an n × 20 chessboard. There are several chesses on the chessboard. They can move one chess in one turn. If there are no other che原创 2016-11-03 17:58:29 · 454 阅读 · 0 评论 -
HDU 5878 - I Count Two Three
Problem DescriptionI will show you the most popular board game in the Shanghai Ingress Resistance Team.It all started several months ago.We found out the home address of the enlightened agent Ic原创 2016-09-24 15:25:46 · 348 阅读 · 0 评论 -
HDU 5883 - The Best Path
Problem DescriptionAlice is planning her travel route in a beautiful valley. In this valley, there are N lakes, and M rivers linking these lakes. Alice wants to start her trip from one lake, and enj原创 2016-09-23 19:33:53 · 347 阅读 · 0 评论 -
HDU 1532 - Drainage Ditches
Problem DescriptionEvery time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long tim原创 2016-10-09 18:28:44 · 334 阅读 · 0 评论 -
HDU 5877 - Weak Pair
Problem DescriptionYou are given a rooted tree of N nodes, labeled from 1 to N. To the ith node a non-negative value ai is assigned.An ordered pair of nodes (u,v) is said to be weak if (1) u is a原创 2016-09-22 20:14:12 · 393 阅读 · 0 评论 -
HDU 5875 - Function
Problem DescriptionThe shorter, the simpler. With this problem, you should be convinced of this truth. You are given an array A of N postive integers, and M queries in the form (l,r). A funct原创 2016-09-19 19:03:33 · 545 阅读 · 0 评论 -
HDU 5872 - Seats
Problem DescriptionThe yearly sports meeting is approaching in Hail university and M departments, conveniently numbered from 1 to M, are going to take part in. Each department has no more than h stu原创 2016-09-18 19:05:05 · 644 阅读 · 0 评论 -
HDU 5879 - Cure【2016 ACM 区域赛青岛赛区网络赛】
Problem DescriptionGiven an integer n, we only want to know the sum of 1/k2 where k from 1 to n.InputThere are multiple cases.For each test case, there is a single line, containing a singl原创 2016-09-18 18:57:17 · 806 阅读 · 0 评论 -
HDU 5874 - Friends ans Enemis
Problem DescriptionOn an isolated island, lived some dwarves. A king (not a dwarf) ruled the island and the seas nearby, there are abundant cobblestones of varying colors on the island. Every two dw原创 2016-09-13 15:17:31 · 426 阅读 · 0 评论 -
HDU 5876 - Sparse Graph
唉这题真是……原创 2016-09-13 14:30:31 · 334 阅读 · 0 评论 -
HDU 5873 - Football Match【2016大连区域赛网络赛1006】
Problem DescriptionA mysterious country will hold a football world championships---Abnormal Cup, attracting football teams and fans from all around the world. This country is so mysterious that none原创 2016-09-12 19:58:12 · 616 阅读 · 0 评论 -
HDU 5904 - LCIS
Problem DescriptionAlex has two sequences a1,a2,...,an and b1,b2,...,bm. He wants find a longest common subsequence that consists of consecutive values in increasing order.InputThere are mul原创 2016-09-28 19:38:43 · 449 阅读 · 0 评论 -
HDU 5952 - Counting Cliques
Problem DescriptionA clique is a complete graph, in which there is an edge between every pair of the vertices. Given a graph with N vertices and M edges, your task is to count the number of cliques原创 2016-11-05 18:25:17 · 749 阅读 · 0 评论 -
HDU 5723 - Abandoned country
Problem DescriptionAn abandoned country has n(n≤100000) villages which are numbered from 1 to n. Since abandoned for a long time, the roads need to be re-built. There are m(m≤1000000) roads to be原创 2016-10-26 19:12:50 · 393 阅读 · 0 评论 -
HDU 5738 - Eureka
Problem DescriptionProfessor Zhang draws n points on the plane, which are conveniently labeled by 1,2,...,n. The i-th point is at (xi,yi). Professor Zhang wants to know the number of best sets. As t原创 2016-11-17 18:42:40 · 454 阅读 · 0 评论 -
HDU 5914 - Triangle
Problem DescriptionMr. Frog has n sticks, whose lengths are 1,2, 3⋯n respectively. Wallice is a bad man, so he does not want Mr. Frog to form a triangle with three of the sticks here.原创 2016-11-28 19:49:46 · 390 阅读 · 0 评论 -
HDU 5900 - QSC and Master
Problem DescriptionEvery school has some legends, Northeastern University is the same.Enter from the north gate of Northeastern University,You are facing the main building of Northeastern Univer原创 2016-10-08 18:54:34 · 315 阅读 · 0 评论 -
HDU 1427 - 速算24点
Problem Description速算24点相信绝大多数人都玩过。就是随机给你四张牌,包括A(1),2,3,4,5,6,7,8,9,10,J(11),Q(12),K(13)。要求只用'+','-','*','/'运算符以及括号改变运算顺序,使得最终运算结果为24(每个数必须且仅能用一次)。游戏很简单,但遇到无解的情况往往让人很郁闷。你的任务就是针对每一组随机产生的四张牌,判断是否有解。我们原创 2016-10-20 18:19:50 · 547 阅读 · 0 评论 -
HDU 5734 - Acperience
Problem DescriptionDeep neural networks (DNN) have shown significant improvements in several application domains including computer vision and speech recognition. In computer vision, a particular ty原创 2016-11-10 16:47:34 · 428 阅读 · 0 评论 -
HDU 5916 - Harmonic Value Description
Problem DescriptionThe harmonic value of the permutation p1,p2,⋯pn is∑i=1n−1gcd(pi.pi+1)Mr. Frog is wondering about the permutation whose harmonic value is the strictly k-th smallest among all原创 2016-10-29 13:05:40 · 348 阅读 · 0 评论 -
HDU 5726 - GCD
Problem DescriptionGive you a sequence of N(N≤100,000) integers : a1,...,an(0<ai≤1000,000,000). There are Q(Q≤100,000) queries. For each query l,r you have to calculate gcd(al,,al+1,...,ar) and coun原创 2016-10-28 17:41:22 · 316 阅读 · 0 评论 -
HDU 5898 - odd-even number
Problem DescriptionFor a number,if the length of continuous odd digits is even and the length of continuous even digits is odd,we call it odd-even number.Now we want to know the amount of odd-even n原创 2016-10-04 18:04:54 · 361 阅读 · 0 评论 -
HDU 5901 - Count Primes
Problem DescriptionEasy question! Calculate how many primes between [1...n]!InputEach line contain one integer n(1 OutputFor each case, output the number of primes in interval [1...n]原创 2016-10-04 10:26:37 · 440 阅读 · 0 评论 -
HDU 5727 - Necklace
Problem DescriptionSJX has 2*N magic gems. N of them have Yin energy inside while others have Yang energy. SJX wants to make a necklace with these magic gems for his beloved BHB. To avoid making the原创 2016-11-08 15:26:57 · 388 阅读 · 0 评论 -
HDU 5884 - Sort
Problem DescriptionRecently, Bob has just learnt a naive sorting algorithm: merge sort. Now, Bob receives a task from Alice.Alice will give Bob N sorted sequences, and the i-th sequence includes a原创 2016-10-03 14:26:34 · 332 阅读 · 0 评论 -
HDU 1285 - 确定名次排序
Problem Description有N个比赛队(1 Input输入有若干组,每组中的第一行为二个数N(1 Output给出一个符合要求的排名。输出时队伍号之间有空格,最后一名后面没有空格。其他说明:符合条件的排名可能不是唯一的,此时要求输出时编号小的队伍在前;输入数据保证是正确的,即输入数据确保一定能有一个符合要求的排名。 S原创 2016-08-22 10:37:55 · 235 阅读 · 0 评论 -
HDU 5806 - NanoApe Loves Sequence Ⅱ
Problem DescriptionNanoApe, the Retired Dog, has returned back to prepare for for the National Higher Education Entrance Examination!In math class, NanoApe picked up sequences once again. He wro原创 2016-08-09 11:19:25 · 300 阅读 · 0 评论 -
HDUOJ 2160 - 母猪的故事
Problem Description话说现在猪肉价格这么贵,著名的ACBoy 0068 也开始了养猪生活。说来也奇怪,他养的猪一出生第二天开始就能每天中午生一只小猪,而且生下来的竟然都是母猪。不过光生小猪也不行,0068采用了一个很奇特的办法来管理他的养猪场:对于每头刚出生的小猪,在他生下第二头小猪后立马被杀掉,卖到超市里。假设在创业的第一天,0068只买了一头刚出生的小猪,请问原创 2016-07-28 12:35:36 · 912 阅读 · 0 评论 -
HDUOJ 1870 - 愚人节的礼物
Problem Description四月一日快到了,Vayko想了个愚人的好办法——送礼物。嘿嘿,不要想的太好,这礼物可没那么简单,Vayko为了愚人,准备了一堆盒子,其中有一个盒子里面装了礼物。盒子里面可以再放零个或者多个盒子。假设放礼物的盒子里不再放其他盒子。用()表示一个盒子,B表示礼物,Vayko想让你帮她算出愚人指数,即最少需要拆多少个盒子才能拿到礼物。 I原创 2016-07-28 12:34:19 · 389 阅读 · 0 评论 -
HDU 1872 - 稳定排序
Problem Description大家都知道,快速排序是不稳定的排序方法。如果对于数组中出现的任意a[i],a[j](i某高校招生办得到一份成绩列表,上面记录了考生名字和考生成绩。并且对其使用了某排序算法按成绩进行递减排序。现在请你判断一下该排序算法是否正确,如果正确的话,则判断该排序算法是否为稳定的。 Input本题目包含多组输入,请处理到文件结束。对原创 2016-07-23 20:22:03 · 435 阅读 · 0 评论 -
HDU 1236 - 排名
Problem Description今天的上机考试虽然有实时的Ranklist,但上面的排名只是根据完成的题数排序,没有考虑 每题的分值,所以并不是最后的排名。给定录取分数线,请你写程序找出最后通过分数线的 考生,并将他们的成绩按降序打印。 Input测试输入包含若干场考试的信息。每场考试信息的第1行给出考生人数N ( 0 名考生的准考证号(长度不超过2原创 2016-07-22 16:29:55 · 291 阅读 · 0 评论 -
HDUOJ 1106 - 排序
Problem Description输入一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格分割的若干非负整数(可能有些整数以‘0’开头,这些头部的‘0’应该被忽略掉,除非这个整数就是由若干个‘0’组成的,这时这个整数就是0)。你的任务是:对这些分割得到的整数,依从小到大的顺序排序输出。 Input输入包含多组测试用例,每组输入数据只有一行数原创 2016-07-22 15:50:03 · 366 阅读 · 0 评论 -
百度之星2016资格赛 1004
Problem Description度熊所居住的 D 国,是一个完全尊重人权的国度。以至于这个国家的所有人命名自己的名字都非常奇怪。一个人的名字由若干个字符组成,同样的,这些字符的全排列的结果中的每一个字符串,也都是这个人的名字。例如,如果一个人名字是 ACM,那么 AMC, CAM, MAC, MCA, 等也都是这个人的名字。在这个国家中,没有两个名字相同的人。度熊想统计这个国家的原创 2016-05-15 14:40:36 · 467 阅读 · 0 评论 -
HDU 5680 - zxa and set
问题描述zxa有一个集合A={a1,a2,⋯,an}A=\{a_1,a_2,\cdots,a_n\}A={a1,a2,⋯,an},nnn表示集合AAA的元素个数,这个集合明显有(2n−1)(2^n-1)(2n−1)个非空子集合。对于每个属于AAA的子集合B={b1,b2,⋯,bm}(1≤m≤n)B=\{b_1,b_2,\cdots,b_m\}(1\leq m\leq原创 2016-05-15 13:31:58 · 775 阅读 · 0 评论 -
HDU 百度之星(测试赛)1004 - 放盘子
Problem Description小度熊喜欢恶作剧。今天他向来访者们提出一个恶俗的游戏。他和来访者们轮流往一个正多边形内放盘子。最后放盘子的是获胜者,会赢得失败者的一个吻。玩了两次以后,小度熊发现来访者们都知道游戏的必胜策略。现在小度熊永远是先手,他想知道他是否能获胜。注意盘子不能相交也不能和多边形相交也不能放在多边形外。就是说,盘子内的点不能在多边形外或者别的盘子内。原创 2016-05-12 19:46:55 · 478 阅读 · 0 评论 -
HDU 百度之星(测试赛)1001 - 大搬家
Problem Description近期B厂组织了一次大搬家,所有人都要按照指示换到指定的座位上。指示的内容是坐在位置iii上的人要搬到位置jjj上。现在B厂有NNN个人,一对一到NNN个位置上。搬家之后也是一一对应的,改变的只有位次。在第一次搬家后,度度熊由于疏忽,又要求大家按照原指示进行了一次搬家。于是,机智的它想到:再按这个指示搬一次家不就可以恢复第一次搬家的样子了。于是,B厂原创 2016-05-10 19:31:20 · 896 阅读 · 2 评论 -
HDU 百度之星(测试赛) - 1002 列变位法解密
Problem Description列变位法是古典密码算法中变位加密的一种方法,具体过程如下将明文字符分割成个数固定的分组(如5个一组,5即为密钥),按一组一行的次序整齐排列,最后不足一组不放置任何字符,完成后按列读取即成密文。比如:原文:123456789密钥:4变换后的矩阵:123456789xxx(最后的几个x表示无任何字符,不是空格,不是制表符,就原创 2016-05-10 13:06:03 · 995 阅读 · 0 评论 -
HDU 百度之星(测试赛)1003 - IP聚合
Problem Description当今世界,网络已经无处不在了,小度熊由于犯了错误,当上了度度公司的网络管理员,他手上有大量的 IP列表,小度熊想知道在某个固定的子网掩码下,有多少个网络地址。网络地址等于子网掩码与 IP 地址按位进行与运算后的结果,例如:子网掩码:A.B.C.DIP 地址:a.b.c.d网络地址:(A&a).(B&b).(C&c).(D&d)原创 2016-05-10 16:25:28 · 1137 阅读 · 0 评论 -
HDUOJ 1276 - 士兵队列训练问题
Problem Description某部队进行新兵队列训练,将新兵从一开始按顺序依次编号,并排成一行横队,训练的规则如下:从头开始一至二报数,凡报到二的出列,剩下的向小序号方向靠拢,再从头开始进行一至三报数,凡报到三的出列,剩下的向小序号方向靠拢,继续从头开始进行一至二报数。。。,以后从头开始轮流进行一至二报数、一至三报数直到剩下的人数不超过三人为止。 Input本题有多原创 2016-07-28 12:37:14 · 487 阅读 · 0 评论