![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
想法
文章平均质量分 79
black_miracle
这个作者很懒,什么都没留下…
展开
-
Codeforces 763B 想法
Timofey and rectanglestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne of Timofey's birthday presents i原创 2017-02-06 20:32:57 · 311 阅读 · 0 评论 -
Codeforces gym 101149 G 想法
Of Zorcs and Axestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputZorcs don't like other species. Zorcs lik原创 2017-04-30 18:09:46 · 532 阅读 · 0 评论 -
Codeforces gym 101149 K 想法
Revenge of the Dragontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne fairy king hated dragons to death原创 2017-04-30 18:20:47 · 505 阅读 · 0 评论 -
Codeforces gym 101102 K 想法
Topological Sorttime limit per test8 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputConsider a directed graph G of N nodes a原创 2017-05-04 18:45:17 · 292 阅读 · 0 评论 -
ZOJ 3965 构造
Binary Tree RestoringTime Limit: 1 Second Memory Limit: 65536 KB Special JudgeGiven two depth-first-search (DFS) sequences of a binary tree, can you find a binary tree which satisf原创 2017-04-23 16:09:36 · 367 阅读 · 0 评论 -
ZOJ 3962 想法
Seven Segment DisplayTime Limit: 2 Seconds Memory Limit: 65536 KBA seven segment display, or seven segment indicator, is a form of electronic display device for displaying decimal numer原创 2017-04-24 16:20:50 · 337 阅读 · 0 评论 -
HDU 6040 Hints of sd0061 stl
Hints of sd0061Time Limit: 5000/2500 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 2301 Accepted Submission(s): 689Problem Descriptionsd0061, t原创 2017-08-01 00:31:28 · 351 阅读 · 0 评论 -
HDU 6050 Funny Function
Funny FunctionTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1215 Accepted Submission(s): 596Problem DescriptionFunction Fx,原创 2017-08-01 00:43:16 · 405 阅读 · 2 评论 -
codeforces 1087D
传送门:http://codeforces.com/contest/1087/problem/D题意:给你一棵树,为每条边分配实数非负实数边权,和为s,使得直径最小。题解:感性理解一下。。。只要把s平均分配到每个叶子节点的边即可。#include<bits/stdc++.h>using namespace std;int du[100005];int main(){...原创 2019-01-17 11:30:09 · 153 阅读 · 0 评论 -
codeforces 1084D
传送门:http://codeforces.com/contest/1084/problem/D题意:给出一棵树,点为正权,边为负权,找出一条简单路径,权和最大。题解:我们定义g[i]代表以i结点为终点,从子树的点上来能获得的最大权值,那么同时要考虑i为转折点,那么只要在子树中找最大和次大的权和即可。#include<bits/stdc++.h>using namesp...原创 2019-01-18 11:22:34 · 205 阅读 · 0 评论 -
codeforces 1084E
传送门:http://codeforces.com/contest/1084/problem/E题意:给出两个字符串s,t,选出k个字符串,使得字典序在[s,t]内且前缀和不同的数量最多。题解:题目是询问构建一颗字典树,最左边不小于s,最右边不大于t,且结点个数最多,那么我们只要左边贴着s走,右边贴着t走即可,也就是如果当前左边不能走a右边不能走b的情况,我们要减掉相应的方案数。#i...原创 2019-01-18 11:27:01 · 181 阅读 · 0 评论 -
codeforces 1061D
传送门:https://codeforces.com/contest/1061/problem/D题意:给你n个节目,每个节目会在[l,r]区间播放,在[a,b]时间租一台电视需要花费x+y*(b-a),一台电视只能同时看一个节目,问最少需要多少钱能看所有节目。题解:贪心,先对节目从左到右排序,然后看当前是要租一台新的电视好还是旧的续租好。#include<bits/stdc+...原创 2019-01-24 10:35:24 · 356 阅读 · 0 评论 -
codeforces 1062F
传送门:https://codeforces.com/contest/1062/problem/F题意:给你一个有向无环图,问有多少点,他能到达的点数+能到他的点数>=n-1题解:能到达的就是正向图,能到他的就是反向图。因为是有向无环图,所以能到达的点和能到他的点的交集是空的。所以只要两幅图中有超过一个点不符合条件,那么这个点就不能被计算进答案里。用拓扑排序解决能到达的问...原创 2019-01-24 12:33:02 · 317 阅读 · 1 评论 -
codeforces 1088E
传送门:https://codeforces.com/contest/1088/problem/E题意:给一棵树,找不超过n个联通块,彼此不相交,且权值总和除以联通块数量最大,如果有多解,要求联通块数量最多。题解:根据平均数可知,答案就是找出来有几个权值和最大的联通块,注意不要彼此覆盖。#include<bits/stdc++.h>using namespace std...原创 2019-01-21 13:57:04 · 154 阅读 · 0 评论 -
codeforces 1101D
传送门:https://codeforces.com/contest/1101/problem/D题意:求一条最长的链,链上所有点的gcd大于1。题解:维护每个点的每个质因子能向下延伸多少。#include<bits/stdc++.h>using namespace std;#define fi first#define se second#define mp m...原创 2019-01-21 14:30:14 · 334 阅读 · 0 评论 -
Codeforces gym 101350F 想法
Monkeying Aroundtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWhen the monkey professor leaves his class原创 2017-04-29 21:10:07 · 1105 阅读 · 2 评论 -
Codeforces 796C 想法
Bank Hackingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlthough Inzane successfully found his beloved原创 2017-04-11 20:06:25 · 391 阅读 · 0 评论 -
ZOJ 3955 想法
Saddle PointTime Limit: 1 Second Memory Limit: 131072 KBChiaki has an n × m matrix A. Rows are numbered from 1 to n from top to bottom and columns are numbered from 1 to m from left to原创 2017-04-10 19:10:50 · 704 阅读 · 0 评论 -
Codeforces 509E 想法
Pretty Songtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputWhen Sasha was studying in the seventh grade, he原创 2017-02-19 21:02:57 · 379 阅读 · 0 评论 -
Codeforces 496D 想法
Tennis Gametime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya and Gena love playing table tennis. A sin原创 2017-03-02 12:58:55 · 269 阅读 · 0 评论 -
Codeforces 229C 想法
Trianglestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlice and Bob don't play games anymore. Now they原创 2017-02-02 00:30:33 · 342 阅读 · 0 评论 -
Codeforces 763A dfs+想法
Timofey and a treetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputEach New Year Timofey and his friends cu原创 2017-02-03 00:49:43 · 412 阅读 · 0 评论 -
Codeforces 776C 想法
Molly's Chemicalstime limit per test2.5 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputMolly Hooper has n different kinds of c原创 2017-02-24 16:56:28 · 258 阅读 · 0 评论 -
ZOJ 3328 想法
Wu XingTime Limit: 1 Second Memory Limit: 32768 KBIntroductionThe Wu Xing, or the Five Movements, Five Phases or Five Steps/Stages, are chiefly an ancient mnemonic device, in many tra原创 2017-02-26 11:26:51 · 304 阅读 · 0 评论 -
SPOJ BIPCSMR16 想法
Team BuildingTo make competitive programmers of BUBT, authority decide to take regular programming contest. To make this contest more competitive and fruitful there are some rules given to bal原创 2017-03-06 17:50:33 · 324 阅读 · 0 评论 -
SWERC'2016 B 想法
BribingEveEve works at a magazine that does productreviews and publishes recommendations to consumers. They are working on a newmobile phones review and have decided on two reproducible tests that原创 2017-03-27 19:32:19 · 459 阅读 · 0 评论 -
Codeforces 55C 想法
Pie or dietime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVolodya and Vlad play the following game. There原创 2017-03-27 21:32:06 · 359 阅读 · 0 评论 -
Codeforces 156B 想法
Suspectstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs Sherlock Holmes was investigating a crime, he i原创 2017-03-11 00:12:44 · 341 阅读 · 0 评论 -
Codeforces 792B 约瑟夫问题
Counting-out Rhymetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputn children are standing in a circle and p原创 2017-03-29 18:38:11 · 276 阅读 · 0 评论 -
USACO 2016 Feb Fenced In 最小生成树
Farmer John has realized that many of his cows are strangely agoraphobic (being fearful of large open spaces). To try and make them less afraid of grazing, he partitions his large field into a numbe原创 2017-03-14 00:41:22 · 398 阅读 · 0 评论 -
Codeforces 788B 想法+并查集
Weird journeytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle boy Igor wants to become a traveller.原创 2017-03-30 15:17:00 · 602 阅读 · 0 评论 -
Codeforces 788C 想法+bfs
The Great Mixingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputSasha and Kolya decided to get drunk with C原创 2017-03-30 21:52:04 · 717 阅读 · 0 评论 -
codeforces 1099E
传送门:http://codeforces.com/contest/1099/problem/E题意:给你一个只包含AGCT的矩阵,让你用AGCT替换掉一些字符,使得每个2*2的子矩阵都包含AGCT,求替换掉最少字符的那个矩阵。题解:经过手动模拟发现,符合题意的矩阵,要么每行只有两种字符交替出现且与相邻行的字符不同,要么每列是上述这样,所以我们只要按行按列枚举,然后对于每行求出最优方案即可...原创 2019-01-16 13:10:26 · 411 阅读 · 0 评论