随笔分类 -  训练--洛谷OnlineJudge

摘要:A题 分析:直接贪心即可,注意要long long 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "string" 5 using namespace std; 6 const int maxn=1 阅读全文
posted @ 2017-07-02 13:56 wolf940509 阅读(134) 评论(0) 推荐(0)
摘要:分析:对于小于等于k的数,每次可以由底部直接到达,一直到i-1直接到达;而对于大于k的数,每次由i-k个一直到i-1个直接到达 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <string> 5 # 阅读全文
posted @ 2016-10-16 00:37 wolf940509 阅读(203) 评论(0) 推荐(0)
摘要:分析:码农题,照这模拟就行,高精度的B进制,注意字符串反转的技巧。 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <string> 5 #include <vector> 6 #include <a 阅读全文
posted @ 2016-10-13 01:08 wolf940509 阅读(174) 评论(0) 推荐(0)
摘要:题意:2000Noip提高组 分析:这题没有理解好题意,最后看了题解之后才做出来的,下面贴一下刘汝佳大神的题解 我先来说说题目的意思。就从样例开始分析。 输入是: 31 28 130 30 120 31 110 -1 -1 15 意思就是政府预期价是31元。成本28元,按成本销售的时候可以买130件 阅读全文
posted @ 2016-10-13 01:07 wolf940509 阅读(1698) 评论(0) 推荐(1)
摘要:分析:第n次的台阶数为dp[n],则dp[n]=dp[n-1]+dp[n-2]; 1 // 2 // main.cpp 3 // 1601 4 // 5 // Created by wanghan on 16/10/12. 6 // Copyright © 2016年 wanghan. All ri 阅读全文
posted @ 2016-10-13 01:07 wolf940509 阅读(175) 评论(0) 推荐(0)
摘要:分析:第一次用STL里面的merge 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <string> 5 #include <vector> 6 #include <algorithm> 7 #in 阅读全文
posted @ 2016-09-21 00:25 wolf940509 阅读(114) 评论(0) 推荐(0)
摘要:洛谷1031 题意:Noip2002提高组 分析:对于长为L的区间,若其正好满足要求,则其中操作的次数为L-1次,否则每次遇到不满足要求的操作的次数加1 1 // 2 // main.cpp 3 // Luogu 4 // 5 // Created by wanghan on 16/9/11. 6 阅读全文
posted @ 2016-09-11 21:39 wolf940509 阅读(149) 评论(0) 推荐(0)
摘要:浴谷1056 题意:Noip2008普及组第二题 分析:因为要求最少的讨论组数,并按照升序输出。首先,我们统计去掉那一行(列)最多可以让多少组的人停止讨论,并把结果按照降序排序,然后我们再将结果按照编号的升序排序即可 1 #include <iostream> 2 #include <cstdio> 阅读全文
posted @ 2016-09-08 13:17 wolf940509 阅读(142) 评论(0) 推荐(0)