![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vjudge
nucleare
这个作者很懒,什么都没留下…
展开
-
Build Tree HDU - 6533
http://acm.hdu.edu.cn/showproblem.php?pid=6533题目描述构建一个m层的满n叉树,所有的边都有权值。每条边的权值从k个数里面选,每个数只能被选一次0是根节点。di表示根节点到i点的距离,我们的目标是使得每个点到根节点的和最小。答案可能很大,请输出取模p后的答案输入输入包含两行第一行四个数,k,m,n,p (2<=k<=2e5 , 2<=p<=1e15)第二行包含k个数,保证k大于等于边数m,k个数每个.原创 2021-04-30 19:25:37 · 253 阅读 · 1 评论 -
A Simple Problem with Integers POJ - 3468 (线段树区间修改求和*)
You have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is to ask for the ...原创 2018-09-14 21:12:12 · 100 阅读 · 0 评论 -
Just a Hook HDU - 1698 (线段树区间修改查询)
In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same length. Now Pud...原创 2018-09-13 20:17:45 · 138 阅读 · 0 评论 -
Find them, Catch them POJ - 1703 (并查集经典)
The police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon and Gang Snake. However, the police first needs to identify which g...原创 2018-07-21 21:05:01 · 177 阅读 · 0 评论 -
食物链 OpenJ_Bailian - 1182 (并查集经典)
动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是"1 X Y",表示X和Y是同类。 第二种说法是"2 X Y",表示X吃Y。 此人对N个动物,用上述两种说法,一句接一句地说出K句话...原创 2018-07-20 21:55:02 · 199 阅读 · 0 评论 -
Washing Clothes POJ - 3211 (分组01背包)
Dearboy was so busy recently that now he has piles of clothes to wash. Luckily, he has a beautiful and hard-working girlfriend to help him. The clothes are in varieties of colors but each piece of the...原创 2018-07-14 20:45:06 · 158 阅读 · 0 评论 -
F - Coins (可行性背包)
Whuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided to buy a very nice watch in a nearby shop. He wante...原创 2018-07-14 09:51:50 · 337 阅读 · 0 评论 -
D - Piggy-Bank
Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The idea behind is simple...原创 2018-07-13 20:26:29 · 342 阅读 · 0 评论 -
C - I NEED A OFFER!
Speakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范围内)。每个学校都有不同的申请费用a(万美元),并且Speakless估计了他得到这个学校offer的可能性b。不同学校之...原创 2018-07-13 20:17:55 · 211 阅读 · 0 评论 -
A - 畅通工程 (prim+ 链式前向星)
省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。 Input测试输入包含若干测试用例。每个测试用例的第1行给出评估的道路条数 N、村庄数目M ( < 100 );随后的 N 行对应村庄间道路的成本...原创 2018-07-19 20:06:55 · 297 阅读 · 0 评论 -
Party Lemonade CodeForces - 913C
A New Year party is not a New Year party without lemonade! As usual, you are expecting a lot of guests, and buying lemonade has already become a pleasant necessity.Your favorite store sells lemonade...原创 2018-07-18 21:21:14 · 169 阅读 · 0 评论 -
F - A Bug's Life (分类并查集)
Background Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only interact with bugs of the opposite gend...原创 2018-07-17 21:25:00 · 200 阅读 · 0 评论 -
E - FatMouse's Speed (DP最长上升子序列变型)
FatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data as possible into a sequence...原创 2018-07-10 20:18:46 · 207 阅读 · 0 评论 -
Tunnel Warfare HDU - 1540 (线段树区间最值***)
Tunnel Warfare HDU - 1540 During the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Generally speaking, villages connected b...原创 2018-09-26 23:05:55 · 139 阅读 · 0 评论 -
不要62 HDU - 2089
不要62 HDU - 2089 杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。 杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。 不吉利的数字为所有含有4或62的号码。例如: 62315 73418 88914 都属于不吉利号码。但是,61152虽然含有...原创 2018-10-15 21:51:07 · 141 阅读 · 0 评论 -
Monitor HDU - 6514 (二维前缀和)
MonitorHDU - 6514Xiaoteng has a large area of land for growing crops, and the land can be seen as a rectangle ofn×mn×m.But recently Xiaoteng found that his crops were often stolen by a group ...原创 2019-04-21 13:19:22 · 505 阅读 · 0 评论 -
D - Covering HDU - 6185 (杜教板子(BM)线性递推式)
D - CoveringHDU - 6185Bob's school has a big playground, boys and girls always play games here after school.To protect boys and girls from getting hurt when playing happily on the playground, ...原创 2019-03-10 14:30:35 · 264 阅读 · 0 评论 -
E - Rank of Tetris HDU - 1811 (拓扑排序+并查集)
E - Rank of Tetris HDU - 1811 自从Lele开发了Rating系统,他的Tetris事业更是如虎添翼,不久他遍把这个游戏推向了全球。为了更好的符合那些爱好者的喜好,Lele又想了一个新点子:他将制作一个全球Tetris高手排行榜,定时更新,名堂要比福布斯富豪榜还响。关于如何排名,这个不用说都知道是根据Rating从高到低来排,如果两个人具有相同的Rating,...原创 2019-01-09 19:19:28 · 160 阅读 · 0 评论 -
COURSES POJ - 1469 (二分匹配:匈牙利算法)
COURSES POJ - 1469 Consider a group of N students and P courses. Each student visits zero, one or more than one courses. Your task is to determine whether it is possible to form a committee of exa...原创 2019-01-13 16:37:26 · 145 阅读 · 0 评论 -
Palindrome POJ - 3974 (manacher马拉车模板)
Palindrome POJ - 3974 Andy the smart computer science student was attending an algorithms class when the professor asked the students a simple question, "Can you propose an efficient algorithm to ...原创 2019-01-12 16:26:25 · 151 阅读 · 0 评论 -
Girls' research HDU - 3294 (manacher马拉车*)
Girls' research HDU - 3294 One day, sailormoon girls are so delighted that they intend to research about palindromic strings. Operation contains two steps: First step: girls will write a long str...原创 2019-01-12 16:07:16 · 121 阅读 · 0 评论 -
吉哥系列故事——完美队形II HDU - 4513
吉哥系列故事——完美队形II HDU - 4513 吉哥又想出了一个新的完美队形游戏! 假设有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] ... h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则就是新的完美队形: 1、挑出的人保持原队形的相对顺序不变,且必须都是在原队形中连续的; 2、左右对称,假设有m个人形成...原创 2019-01-11 23:24:37 · 129 阅读 · 0 评论 -
I - Cow Contest POJ - 3660
I - Cow Contest POJ - 3660 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 c...原创 2019-01-11 13:24:22 · 188 阅读 · 0 评论 -
G - Sorting It All Out POJ - 1094
G - Sorting It All Out POJ - 1094 An ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to largest. For exam...原创 2019-01-10 15:18:45 · 177 阅读 · 0 评论 -
Instrction Arrangement HDU - 4109 (拓扑排序*)
Instrction Arrangement HDU - 4109 Ali has taken the Computer Organization and Architecture course this term. He learned that there may be dependence between instructions, like WAR (write after rea...原创 2018-12-06 21:15:39 · 147 阅读 · 0 评论 -
F - 确定比赛名次 HDU - 1285 (拓扑排序入门)
确定比赛名次 HDU - 1285 有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时P1在P2之前。现在请你编程序确定排名。 Input输入有若干组,每组中的第一行为二个数N(1...原创 2018-12-06 21:07:05 · 115 阅读 · 0 评论 -
Werewolf HDU - 6370 (dfs )
Werewolf HDU - 6370 "The Werewolves" is a popular card game among young people.In the basic game, there are 2 different groups: the werewolves and the villagers. Each player will debate a player ...原创 2018-12-03 19:57:12 · 183 阅读 · 0 评论 -
National Day Parade HDU - 3687
National Day Parade HDU - 3687 There are n×n students preparing for the National Day parade on the playground. The playground can be considered as a n×m grid. The coordinate of the west north corn...原创 2018-11-11 20:11:26 · 172 阅读 · 0 评论 -
Happy Sequence ZOJ - 4011 (dp)
Happy Sequence ZOJ - 4011 A sequence of integers () is called a happy sequence if each number divides (without a remainder) the next number in the sequence. More formally, we can say for all , ...原创 2018-10-21 20:40:24 · 159 阅读 · 1 评论 -
C - Max Sum (DP最大连续子序列和)
Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14. ...原创 2018-07-10 16:07:02 · 454 阅读 · 0 评论 -
F - Common Subsequence (DP最长公共子序列)
A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = <x1, x2, ..., xm> another sequence Z = <z1, z2, ..., zk> is a subs...原创 2018-07-10 16:04:27 · 181 阅读 · 0 评论 -
C - Nightmare (双bfs)
Ignatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrinth has an exit, Ignatius should get out of the labyrinth before the bomb explodes. The initial ...原创 2018-05-03 15:05:26 · 195 阅读 · 0 评论 -
D - Prime Path
The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It is a matter of sec...原创 2018-05-02 20:37:37 · 179 阅读 · 0 评论 -
A - A strange lift (bfs)
There is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every floor.The lift have just two buttons: up and down.When you at floor i,if...原创 2018-05-02 17:20:01 · 136 阅读 · 0 评论 -
K - 迷宫问题
K - 迷宫问题 定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。Input一个5 × ...原创 2018-04-24 21:55:11 · 327 阅读 · 0 评论 -
F - Broken Keyboard (a.k.a. Beiju Text)
代码:#include<iostream>#include<cstdio>using namespace std;int main(void){ int n,m,k,i,j,sum; int a[30]; while(scanf("%d %d %d",&n,&k,&m)) { if(n==0&&m==0&...原创 2018-04-19 21:11:05 · 163 阅读 · 0 评论 -
Catch That Cow(bfs启蒙题)
Catch That Cow(百练4001)Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a ...原创 2018-04-22 20:56:12 · 311 阅读 · 0 评论 -
N - 又见LKity (字符串替换)
嗨!大家好,在TempleRun中大家都认识我了吧。我是又笨又穷的猫猫LKity。很高兴这次又与各位FZU的ACMer见面了。最近见到FZU的各位ACMer都在刻苦地集训,整天在日光浴中闲得发慌的我压力山大呀!于是,我准备为诸位编写一款小工具——LKity牌文本替换(众怒,:敢不敢更土点!)。这个小工具可以帮助诸位替换代码中的变量等功能,真心是一款编程,刷题必备的神器。其功能如下:将给定的字符序列...原创 2018-04-12 21:25:24 · 178 阅读 · 0 评论 -
E - Parentheses Balance
E - Parentheses BalanceYou are given a string consisting of parentheses () and []. A string of this type is said to be correct:(a) if it is the empty string(b) if A and B are correct, AB is correct,(c...原创 2018-04-17 20:52:52 · 325 阅读 · 0 评论 -
P - 找新朋友
新年快到了,“猪头帮协会”准备搞一个聚会,已经知道现有会员N人,把会员从1到N编号,其中会长的号码是N号,凡是和会长是老朋友的,那么该会员的号码肯定和N有大于1的公约数,否则都是新朋友,现在会长想知道究竟有几个新朋友?请你编程序帮会长计算出来。Input第一行是测试数据的组数CN(Case number,1<CN<10000),接着有CN行正整数N(1<n<32768),表...原创 2018-04-11 20:44:27 · 107 阅读 · 0 评论