- 博客(14)
- 收藏
- 关注
原创 【动态规划】HDU1244Max Sum Plus Plus Plus
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1244这个题目要注意,n个数都是正整数。注意如果多一个段,状态怎么转移#includeusing namespace std;const int N=1050;const int INF=1<<29;int a[N],b[N],sum[N];int dp[N][N];void ini
2017-08-31 14:56:44 430
原创 【贪心/01背包】HDU1735字数统计
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1735#includeusing namespace std;const int N=10050;const int M=25;const int L=105;int a[N][L];int dp[M];int n,m,l;int ans=0;void init(){ a
2017-08-27 15:14:58 260
原创 【枚举】HDU5104Primes Problem【BestCoder Round #18】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5104#includeusing namespace std;const int N=10005;int prime[N]={0};bool notPrime[N];int len=0;int dp[N*3]={0}; // 枚举p1+p2的和的方案数;void get_p
2017-08-17 02:06:10 428
原创 【计数】HDU5804Price List【BestCoder Round #86】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5804#includeusing namespace std;int main(){ int t,n,m; cin.sync_with_stdio(false); cin>>t; while(t--){ cin>>n>>m; st
2017-08-14 21:52:04 168
原创 【枚举计数】HDU5907Find Q【BestCoder Round #88】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5907#includeusing namespace std;int main(){ int t; string s; cin.sync_with_stdio(false); cin>>t; while(t--){ cin>>s;
2017-08-12 12:58:24 292
原创 【枚举】HDU5944Fxx and string【BestCoder Round #89】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5944#includeusing namespace std;int main(){ int t; string s; cin.sync_with_stdio(false); cin>>t; while(t--){ cin>>s;
2017-08-12 12:40:56 250
原创 【思维/DP】HDU6016Count the Sheep【BestCoder Round #92】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6016方法一(思维):四只羊,中间开始枚举;#includeusing namespace std;const int N=100005;int a[N],b[N],bb[N];int main(){ int t,n,m,k; cin.sync_with_stdio(f
2017-08-09 01:34:24 374
原创 【STL】HDU6019MG loves gold【 BestCoder Round #93】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6019这个题目听说有很有的AC姿势哦0.0由于一把铲子不能挖掘同种颜色的金克拉,我们只要线性扫描序列即可。按照贪心思想,若当前颜色种类的金克拉已经在挖掘范围内,我们只能迫不得已地换一把铲子,此时答案+1+1。同时我们需要O(nlogn)O(nlogn)的时间将所有颜色离散
2017-08-08 22:11:02 384
原创 【结构体排序】HDU6015Skip the Class【BestCoder Round #92】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6015#include#includeusing namespace std;const int N=1005;struct node{ string s; int v;}score[N];bool cmp(node a,node b){ if(a.s!=b.
2017-08-08 10:16:17 219
原创 【枚举计数】HDU5995Kblack loves flag【BestCoder Round #90】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5995#include#include#includeusing namespace std;// 获取随机位置const int _K=50268147,_B=6082187,_P=100000007;const int N=1000001;int _X;inline int
2017-08-07 14:30:26 257
原创 【水题】HDU4931Happy Three Friends【BestCoder Round #4】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4931#include#includeusing namespace std;int a[10];int main(){ int t; cin>>t; while(t--){ for(int i=0;i<6;i++){ cin
2017-08-07 13:49:27 534
原创 【枚举标记】HDU4907Task schedule【BestCoder Round #3】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4907#include#include#includeusing namespace std;const int N=200005;int tmp[N];int a[N],ans[N];int n,m;void Input(){ memset(tmp,0,sizeof(tm
2017-08-07 01:39:53 351
原创 【结构体排序】HDU4883TIANKENG’s restaurant【BestCoder Round #2】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4883#include#include#include#include#includeusing namespace std;const int N=10005;int n; // group数量struct node{ int sh,sm; int eh,em
2017-08-06 16:13:48 268
原创 【简单枚举】HDU4858项目管理【BestCoder Round #1】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4858#include#include#include#includeusing namespace std;const int N=100020;vectorMap[N];int v[N];int getSum(int a){ int ans=0; for(int
2017-08-06 12:27:25 208
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人