上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 66 下一页
摘要: #include #include #include #ifdef URLDownloadToFile#undef URLDownloadToFile#endiftypedef int(__stdcall *UDF)(LPVOID,LPCSTR,LPCSTR... 阅读全文
posted @ 2018-09-12 20:32 Monster_Qi 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 传送门解题思路比较有意思的一道思路题,首先假如有两个点,每个点的人数都是1,那么将车站建在两个点之间的任意一个位置最后的答案均为这两点的长度,那么考虑在加一个人数为1的点在这两个之间,那么最优的一定是在这个点建在新加的点上,这样的长度还是原来两点的长度,然后... 阅读全文
posted @ 2018-09-12 16:30 Monster_Qi 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 传送门解题思路树形背包,dp[x][i] 表示以x为根的子树留i个树枝的最大值。代码#include#include#include#includeusing namespace std;const int MAXN = 105;inline int rd(... 阅读全文
posted @ 2018-09-11 21:29 Monster_Qi 阅读(66) 评论(0) 推荐(0) 编辑
摘要: 传送门解题思路明显的树形背包,dp[x][j] 表示以x为根的子树选j个用户的最大值,最后答案取一个最大的j使得dp[1][j] > 0 就行了。代码#include#include#include#includeusing namespace std;co... 阅读全文
posted @ 2018-09-11 20:58 Monster_Qi 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 传送门解题思路这题怕是noi的耻辱,理解题意有点困难,是建好树以后算,并不是决策。理解题意后就十分简单了,一遍dfs。代码#include#include#include#include#include#include#define LL long long... 阅读全文
posted @ 2018-09-11 20:34 Monster_Qi 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 题面解题思路动态规划,刚开始想的是dp[i][j][k]表示考虑了前i个数,A集合异或和为j,B集合异或和为k,时间复杂度O(n^3) ,得了50分。。正解应该是dp[i][j][k]表示前i个数,A^B=j,A与B第一位不同的数,B的这一位为k的方案数,因... 阅读全文
posted @ 2018-09-07 17:08 Monster_Qi 阅读(104) 评论(1) 推荐(0) 编辑
摘要: 传送门解题思路树链剖分,把dfs序用线段树维护,记录一个最大值,记录一个和,两个函数。代码#include#include#include#includeusing namespace std;const int MAXN=30005;inline int ... 阅读全文
posted @ 2018-09-02 23:36 Monster_Qi 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 传送门解题思路树链剖分裸题,线段树维护。代码#include#include#include#define int long longusing namespace std;const int MAXN = 100005;inline int rd(){ ... 阅读全文
posted @ 2018-09-02 22:57 Monster_Qi 阅读(74) 评论(0) 推荐(0) 编辑
摘要: 题目描述GG 公司有 nn 个沿铁路运输线环形排列的仓库,每个仓库存储的货物数量不等。如何用最少搬运量可以使 nn 个仓库的库存数量相同。搬运货物时,只能在相邻的仓库之间搬运。输入输出格式输入格式: 文件的第 11 行中有 11 个正整数 nn ,表示有 n... 阅读全文
posted @ 2018-08-26 15:46 Monster_Qi 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 传送门解题思路首先建一张反图,从终点dfs出哪个点直接或间接相连,然后直接跑最短路,跑的时候判断一下所连的点是否与终点相连。代码#include#include#include#include#include#includeusing namespace s... 阅读全文
posted @ 2018-08-25 22:11 Monster_Qi 阅读(86) 评论(0) 推荐(0) 编辑
上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 66 下一页