2020年9月9日

摘要: A Ahahahahahahahaha 题意:给出一个只有0和1组成的数组(从a1到an),奇数项加上,偶数项减去。例如110,就是1-1+0。我们可以在数组中去掉 最多n/2个元素,使得数组和为0. 题解:如果所有元素和刚好为0,那么直接输出。否则,需要删除一个元素。 我们将其划分为三段,a*b( 阅读全文
posted @ 2020-09-09 18:13 学无止境的小程序员 阅读(144) 评论(0) 推荐(0) 编辑

2020年8月12日

摘要: http://poj.org/problem?id=1459 最大流(dinic)问题,开始因为多开了一个数组,多进行了一次memset一直超时。 #include<stdlib.h> #include<stdio.h> #include<string.h> #include<queue> usin 阅读全文
posted @ 2020-08-12 15:45 学无止境的小程序员 阅读(97) 评论(0) 推荐(0) 编辑

2020年8月10日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4734 算法:数位DP dp[pos][V]意味着当第pos位确定时,权值小于V的数有几个。 稍微计算一下,最高位得权值也不到1000,所以我把V的大小定义为了10000。 #include<bits/stdc++ 阅读全文
posted @ 2020-08-10 14:46 学无止境的小程序员 阅读(72) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=3652 #include<bits/stdc++.h> using namespace std; int dp[25][10][2][200];//dp[pos][last digit][13 is exi 阅读全文
posted @ 2020-08-10 11:04 学无止境的小程序员 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=3709 枚举中心位置,进行数位DP #include<bits/stdc++.h> using namespace std; typedef long long ll; ll dp[25][25][5000 阅读全文
posted @ 2020-08-10 10:25 学无止境的小程序员 阅读(88) 评论(0) 推荐(0) 编辑

2020年8月8日

摘要: #include<bits/stdc++.h> using namespace std; typedef long long ll; ll dp[25][2];//dp[pos][last is 4] ll n; vector<int>s; ll dfs(int pos,int is4,int sp 阅读全文
posted @ 2020-08-08 18:07 学无止境的小程序员 阅读(69) 评论(0) 推荐(0) 编辑

2019年5月8日

摘要: 题目描述 题意:有一块N×M的土地,雨后积起了水,有水标记为‘W’,干燥为‘.’。八连通的积水被认为是连接在一起的。请求出院子里共有多少水洼? 输入 第一行为N,M(1≤N,M≤110)。 下面为N*M的土地示意图。 输出 一行,共有的水洼数。 样例输入 10 12 W........WW. .WW 阅读全文
posted @ 2019-05-08 19:42 学无止境的小程序员 阅读(321) 评论(0) 推荐(0) 编辑

导航