
贪心
文章平均质量分 51
贪心
ShadyPi
写写博客当笔记
展开
-
挑战性题目DSCT102:木板切割问题
UESTC 数据结构挑战性课程题目原创 2022-01-12 19:23:36 · 732 阅读 · 0 评论 -
Luogu1514 引水入城
原题链接:https://www.luogu.com.cn/problem/P1514引水入城题目描述在一个遥远的国度,一侧是风景秀美的湖泊,另一侧则是漫无边际的沙漠。该国的行政区划十分特殊,刚好构成一个NNN 行×M\times M×M列的矩形,如上图所示,其中每个格子都代表一座城市,每座城市都有一个海拔高度。为了使居民们都尽可能饮用到清澈的湖水,现在要在某些城市建造水利设施。水利设施有两种,分别为蓄水厂和输水站。蓄水厂的功能是利用水泵将湖泊中的水抽取到所在城市的蓄水池中。因此,只有与湖泊毗原创 2020-09-21 16:09:21 · 265 阅读 · 0 评论 -
CF1399E2 Weights Division (hard version)
原题链接:http://codeforces.com/problemset/problem/1399/E2Weights Division (hard version)Easy and hard versions are actually different problems, so we advise you to read both statements carefully.You are given a weighted rooted tree, vertex 1 is the root of原创 2020-08-31 23:01:27 · 401 阅读 · 0 评论 -
CF1399E1 Weights Division (easy version)
原文链接:http://codeforces.com/problemset/problem/1399/E1Weights Division (easy version)Easy and hard versions are actually different problems, so we advise you to read both statements carefully.You are given a weighted rooted tree, vertex 1 is the root of原创 2020-08-28 23:35:41 · 308 阅读 · 0 评论 -
CF1399D Binary String To Subsequences
原题链接:http://codeforces.com/problemset/problem/1399/DBinary String To SubsequencesYou are given a binary string s consisting of n zeros and ones.Your task is to divide the given string into the minimum number of subsequences in such a way that each char原创 2020-08-25 22:23:36 · 279 阅读 · 0 评论 -
CF1399B Gifts Fixing
原题链接:http://codeforces.com/problemset/problem/1399/BGifts FixingYou have n gifts and you want to give all of them to children. Of course, you don’t want to offend anyone, so all gifts should be equal between each other. The i-th gift consists of ai cand原创 2020-08-22 10:53:51 · 313 阅读 · 0 评论 -
CF1399A Remove Smallest
原题链接:http://codeforces.com/problemset/problem/1399/ARemove SmallestYou are given the array a consisting of n positive (greater than zero) integers.In one move, you can choose two indices i and j (i≠j) such that the absolute difference between ai and aj原创 2020-08-21 21:55:35 · 222 阅读 · 0 评论 -
[2018.10.31 T2] 电梯
电梯(lift)题目背景打完昆特牌后你不准备参加 NOIPNOIPNOIP 模拟赛了,因为你有更重要的赛事— NOGPNOGPNOGP(NationalOlympiad in Gwent in Provinces)你现在要上电梯去 NNN 楼参加 NOGPNOGPNOGP。在你从 111 楼上电梯的同时,你发现另有一台空电梯从 111 楼同时向 NNN 楼向上。题面描述NNN 层楼中有...原创 2018-11-01 19:11:46 · 421 阅读 · 0 评论 -
[2018.10.20 T1] 蛋糕
暂无链接蛋糕【问题描述】小 G 想做一个大蛋糕。现在小 G 手上只有NNN块高为111的长方体小蛋糕,第iii块小蛋糕的底面尺寸是Ai×BiA_i\times B_iAi×Bi。小 G 想用堆叠的方式将它们拼成一个大蛋糕,但要想把小蛋糕iii放在另一小蛋糕jjj上方,必须要满足Ai<AjA_i<A_jAi<Aj且Bi<BjB_i<B_jBi<Bj,否则成品就会非常不美观。小...原创 2018-10-24 19:25:38 · 309 阅读 · 0 评论 -
Luogu2279[HNOI2003] 消防局的设立
原题链接:https://www.luogu.org/problemnew/show/P2279消防局的设立题目描述202020202020年,人类在火星上建立了一个庞大的基地群,总共有nnn个基地。起初为了节约材料,人类只修建了n−1n-1n−1条道路来连接这些基地,并且每两个基地都能够通过道路到达,所以所有的基地形成了一个巨大的树状结构。如果基地AAA到基地BBB至少要经过ddd条道路...原创 2018-10-26 09:52:15 · 344 阅读 · 0 评论 -
Luogu1525 关押罪犯
原题链接:https://www.luogu.org/problemnew/show/P1525关押罪犯题目描述SSS城现有两座监狱,一共关押着NNN名罪犯,编号分别为1−N1-N1−N。他们之间的关系自然也极不和谐。很多罪犯之间甚至积怨已久,如果客观条件具备则随时可能爆发冲突。我们用“怨气值”(一个正整数值)来表示某两名罪犯之间的仇恨程度,怨气值越大,则这两名罪犯之间的积怨越多。如果两名...原创 2018-10-16 15:22:44 · 229 阅读 · 0 评论 -
有序表的最小和(element)
暂无链接有序表的最小和[问题描述]给出两个长度为n的有序表A和在A和B中各任取一个元素,可以得到n^2个和,求 这些和中最小的n个.[输入格式]第一行包含一个整数n(n<400000); 第二行与第三行分别有n个整数,分别代表有序表A和B。整数之间由一个空格隔开, 大小在长整型范围内,保证有序表的数据单调递增.[输出格式]输出共n行,每行一个...原创 2018-04-18 23:02:10 · 1326 阅读 · 0 评论 -
CF991B Getting an A
原题链接:http://codeforces.com/contest/991/problem/BGetting an ATranslator’s note: in Russia’s most widespread grading system, there are four grades: 5, 4, 3, 2, the higher the better, roughly corre...原创 2018-09-11 10:11:50 · 378 阅读 · 0 评论 -
[FJOI2014] 石子合并问题
暂无链接石子合并问题问题描述有n堆石子,每堆1个,要合并成一堆,规定每次可以任意选两堆合并成新的一堆,两堆中较少的石子数记为该次合并的得分。输入n输出最大得分样例输入7样例输出9题解水题。。。贪心一波,肯定小的跟小的合并划算一些。代码#include<bits/stdc++.h>using nam...原创 2018-04-21 11:22:03 · 221 阅读 · 0 评论 -
BZOJ3668[NOI2014] 起床困难综合症
原题链接:https://www.lydsy.com/JudgeOnline/problem.php?id=3668起床困难综合症Description21 世纪,许多人得了一种奇怪的病:起床困难综合症,其临床表现为:起床难,起床后精神不佳。作为一名青春阳光好少年,atm 一直坚持与起床困难综合症作斗争。通过研究相关文献,他找到了该病的发病原因:在深邃的太平洋海底中,出现了...原创 2018-04-28 18:25:14 · 258 阅读 · 0 评论 -
Luogu4712「生物」能量流动
原题链接:https://www.luogu.org/problemnew/show/P4712「生物」能量流动继续水我的博客。。。因为我们啥都能吃,所以能量的流动对我们来说是不必要的,只需要养活其他动物,尽量减少能量损失即可。看起来还是有点难???冷静观察一下:ri≤ri+1(1≤i<n),ri<i(1≤i≤n)ri≤ri+1(1≤i<n),ri...原创 2018-06-21 23:42:42 · 364 阅读 · 0 评论 -
[2018.07.10 T2]不回文
暂无链接不回文【问题描述】学不会最小回文串划分的豆豆决定弃疗选择挑战非回文划分。 他想知道一个字符串 S 的最少和最多能划分成几个非回文串? 注: 如果一个字符串不是回文串,那么他是非回文串。例如()()是非回文串,而 ())(是回文串。 【输入格式】第一行一个整数 T,表示测试数据组数。 接下来 T 行,每行一个仅由小写字母构成的字符串 S。 【输出格式】...原创 2018-07-11 17:41:19 · 364 阅读 · 0 评论 -
CF1041A Heist
原题链接:http://codeforces.com/contest/1041/problem/ACF1041A HeistThere was an electronic store heist last night.All keyboards which were in the store yesterday were numbered in ascending order from s...原创 2018-09-17 21:42:40 · 411 阅读 · 0 评论 -
CF1042A Benches
原题链接:http://codeforces.com/contest/1042/problem/ABenchesThere are nnn benches in the Berland Central park. It is known that aia_iai people are currently sitting on the iii-th bench. Another mmm pe...原创 2018-09-18 08:18:30 · 431 阅读 · 0 评论 -
CF1042C Array Product
原题链接:http://codeforces.com/contest/1042/problem/CArray ProductYou are given an array aaa consisting of nnn integers. You can perform the following operations with it:Choose some positions iii and...原创 2018-09-18 09:38:09 · 347 阅读 · 0 评论 -
CF984A Game
原题链接:http://codeforces.com/contest/984/problem/AGameTwo players play a game.Initially there are nnn integers a1,a2,⋯,ana1,a2,⋯,ana_1,a_2,\cdots,a_n written on the board. Each turn a player sel...原创 2018-09-13 08:51:02 · 218 阅读 · 0 评论 -
CF1041F Ray in the tube
原题链接:http://codeforces.com/contest/1041/problem/FRay in the tubeYou are given a tube which is reflective inside represented as two non-coinciding, but parallel to OxOxOx lines. Each line has some s...原创 2018-09-18 20:16:52 · 965 阅读 · 0 评论 -
CF651A Joysticks
原题链接:http://codeforces.com/problemset/problem/651/AJoysticksDescriptionFriends are going to play console. They have two joysticks and only one charger for them. Initially first joystick is...原创 2018-04-20 19:29:31 · 334 阅读 · 0 评论