
搜索
文章平均质量分 61
1
__meteor
对于未来, 我只是一个孩子;
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
CodeForces - 330D Biridian Forest
D. Biridian Foresttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou're a mikemon breeder currently in th原创 2017-09-26 23:37:38 · 246 阅读 · 0 评论 -
poj-3070 skiing
SkiingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 5228 Accepted: 1389 Special JudgeDescriptionBessie and the rest of Farmer John's cows are taki原创 2017-09-13 18:01:00 · 291 阅读 · 0 评论 -
poj2312-Battle City
Battle CityTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9255 Accepted: 3065DescriptionMany of us had played the game "Battle city" in our childhood,原创 2017-09-10 22:37:59 · 234 阅读 · 0 评论 -
HDU5456 记忆化搜索
传送门题意:给你n个火柴,能拼成几个A-B=C的等式思路:可以转换位B+C=A,这个题不允许有前导零,0这个数也是不行的,我们 从个位开始同时对B,C进行搜索,看是否满足状态表示是dp[n][B][C][carry]:表示还剩余n个火柴,B是否继续,C是否继续,这一位有没有进位。#include<bits/stdc++.h>using namespace std;...原创 2018-08-31 11:07:55 · 180 阅读 · 0 评论 -
HDU 6370(思维)
传送门思路:因为狼说什么都是可以的,所以全是狼是可以,村民为0。那问题就是转化成求铁狼的数量。我们对村民边建图,我们发现,一个连通分量要么是个基环树,要么是个树。对于基环树全是村民的话显然成立。所以不存在铁狼。对于树,必然有且仅有一个点连出去的是狼边,①如果这条边指向其他连通分量,其他联通分量完全可以都是狼,那这个人就可能是个人,所以他不是铁狼。②如果指向自己的连通分量,如果他是狼,那么这...原创 2018-08-10 14:49:27 · 376 阅读 · 0 评论 -
HYSBZ - 4753最佳团体(01分数规划+树形dp)
传送门思路:首先这是一道01分数规划,二分枚举答案也就是 成立,l=mid,提高答案, 否则 r=mid, 减小答案然后是树形dp,有两种方法:第一种:直接dp, dp[i][j]为i节点必选,以i为根节点的子树选择j个的最大值转移方程为 rt根节点+其他子树选j个, 该子树选c个第二种:先求出dfs序, 再dp;if(dp[i][j]+val[i]>dp[i+1...原创 2018-08-04 22:42:19 · 201 阅读 · 0 评论 -
acdream 1726 A Math game(部分和)
A Math gameTime Limit: 2000/1000MS (Java/Others) Memory Limit: 256000/128000KB (Java/Others)Submit StatusProblem DescriptionRecently, Losanto find an interesting Math game. The rule原创 2017-10-24 20:16:40 · 222 阅读 · 0 评论 -
acdream 1015 Double Kings(树的重心)
Double KingsTime Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others)Submit StatusProblem DescriptionOur country is tree-like structure, that is to say that N原创 2017-10-24 18:36:51 · 321 阅读 · 0 评论 -
poj-2676sudoku
思路:深搜, 主要是判断是否在同一行,同一列,同一格。#include#include#include#includeusing namespace std;const int maxn=10;const int INF=0x3f3f3f3f;int T, cnt;int mp[maxn][maxn], row[maxn][maxn], col[maxn][maxn], gri原创 2017-08-27 09:38:48 · 376 阅读 · 0 评论 -
poj1321-棋盘问题(深搜)
思路:用深搜, 注意有两个终止条件。一个是棋盘的范围, 一个是棋子的数量。但是注意棋子的判断要在棋盘的前面。因为可能这一次的搜索超出了棋盘, 但是这一次也刚好是棋子的数量。#include#include#include#includeusing namespace std;const int maxn=10;const int INF=0x3f3f3f3f; int row[m原创 2017-08-27 09:27:29 · 220 阅读 · 0 评论 -
Oil Deposits
原题点这里题意:算出一共多少块油田, 只要上下左右对角线相连就算一个。思路:遍历每个点,只要是油田就以这个点深搜或者广搜, 将搜到的@变为 * ,每调用一次就+1.深搜:#include#include#includeusing namespace std;const int maxn=1e2+10;char _map[maxn][maxn];int m, n;int原创 2017-07-25 11:30:37 · 199 阅读 · 0 评论 -
hdu-2553 N皇后(深搜)
原题思路:以列深搜, 看每一行是否符合条件, 注意打表,否则超时。#include#includeusing namespace std;int n, cnt;int line[15], ans[11];void dfs(int r){ if(r==n+1) { cnt++; return; } for(int i=1; i<=n; i++) { in原创 2017-08-23 13:09:20 · 210 阅读 · 0 评论