上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 35 下一页
摘要: 入门题:https://www.luogu.com.cn/problem/P1337 #include<cstdio> #include<cmath> #include<ctime> #include<cstdlib> #define RG register #define R RG long do 阅读全文
posted @ 2020-08-07 14:01 starve_to_death 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 题:https://ac.nowcoder.com/acm/contest/5671/J 题意:初始序列为1 2 3。。。n,给定m个操作[k,x]代表对序列连续执行x次k-约瑟夫变换 题解: #include <bits/stdc++.h> using namespace std; #define 阅读全文
posted @ 2020-08-05 22:07 starve_to_death 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 题:https://ac.nowcoder.com/acm/contest/6877/A 题意:店每天有m个物品,每个物品都有代价c,现有n天,你每天要用一件。问要如何购买代价最小。且在一天中购买k件会增加代价k^2。 分析:设dp[i][j]表示第 i 天购买了 j 个物品的最小代价,dp[i][ 阅读全文
posted @ 2020-08-05 10:35 starve_to_death 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 题:https://ac.nowcoder.com/acm/contest/5673/I 题意:给定n对点对,每次只能从点对中取出之前没有取过的点,问最多能取到多少个不同的点。 分析:将点设为图上的点,点对即为边,离散化一下数据总共的点数为m,对于图的一个连通分量,假设它的大小为x,那么若这个连通分 阅读全文
posted @ 2020-08-04 13:05 starve_to_death 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 题:https://ac.nowcoder.com/acm/contest/5672/C 题意:给定树,m个操作:(1)在x点处增加w,树上每个点y的值+=w-dis(x,y)。 (2)将x点处值和0取min (3)查询x点的值 分析:将每个点x 的值展开=w-dep(x)-dep(y)+2*dep 阅读全文
posted @ 2020-08-02 14:53 starve_to_death 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 题:https://ac.nowcoder.com/acm/contest/5670/A 题意:给出n个点m条边的有边权连通图,k个任务,每个任务表示为[u,v],表示必须走到u节点再走到v节点,任务必须按1~k次序完成。其中你可以在经过的节点上设置传送点,俩个传送点之间的代价为0,图上最多有2个传 阅读全文
posted @ 2020-07-31 21:11 starve_to_death 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 题:https://ac.nowcoder.com/acm/contest/5670/B 题意:给定初始树[u,v,w],可以对树进行增加任意权重边,和删除任意边,前提是这个过程中图要保证连通且若有环则要保证环异或和为0,求操作后的最小权值和 分析:可以发现任意两个点之间连边的权值都是固定的。由于图 阅读全文
posted @ 2020-07-31 13:24 starve_to_death 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 题:https://codeforces.com/problemset/problem/888/G 模板题 #include<bits/stdc++.h> using namespace std; #define pb push_back #define MP make_pair typedef l 阅读全文
posted @ 2020-07-31 12:44 starve_to_death 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 题:https://ac.nowcoder.com/acm/contest/5671/H 题意:定义S(x)为x作为十进制的各个位数之和,问1~n中多少点对满足S(A)>S(B) (0<=A<=B<=N)(1<=N<=10^100); 分析:字符串范围,考虑数位dp,dp[i][j][limit1] 阅读全文
posted @ 2020-07-28 16:48 starve_to_death 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 题:http://acm.hdu.edu.cn/showproblem.php?pid=6779 题意:给定a,b,c三种饮料数目和n个人,每个人有喜欢的饮料排名,价值依次是1、2、3,(最多6种类型的人)问分配后得到的最大总价值是多少。 分析:建边:1、源点向6类人建容量为这一类人出现的数目,费用 阅读全文
posted @ 2020-07-27 10:20 starve_to_death 阅读(138) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 35 下一页