Fork me on GitHub
摘要: [题目链接](https://share.weiyun.com/9b72b3b07a3b1d8f221bf7f1dd554985) T1 60分可以写一些特判和暴力。 100分dp,解释一下dp的做法。 我们用f[i][j]表示跳了i次,到第j层楼然后跳下去,需要的最小花费。 还需要知道一个策略,如果跳过的楼是一样的,那么以高度升序或者降序肯定比乱跳更优。 那么我们先将所有的楼按照高度升序或者... 阅读全文
posted @ 2017-10-30 16:37 primes 阅读(184) 评论(0) 推荐(0)
摘要: https://www.luogu.org/problem/show?pid=1215#sub 暴力模拟多种情况。我是用搜索写的,注意返回条件和约束条件。#include#include#include#include#includeusing namespace std;int a... 阅读全文
posted @ 2017-09-24 17:48 primes 阅读(136) 评论(0) 推荐(0)
摘要: https://www.luogu.org/problem/show?pid=1214#sub 暴力枚举题,加上一些剪枝。 (原谅我卑劣地提交了两个答案特判)#include#include#include#include#includeusing namespace std;int... 阅读全文
posted @ 2017-09-24 17:48 primes 阅读(115) 评论(0) 推荐(0)
摘要: https://www.luogu.org/problem/show?pid=1207#sub 练好基本功 进制转换#include#include#include#include#includeusing namespace std;int n,s,a[1000],t,ans[10... 阅读全文
posted @ 2017-09-24 17:48 primes 阅读(139) 评论(0) 推荐(0)
摘要: https://www.luogu.org/problem/show?pid=1205大大大大大大枚举! 通过纸上画图来找各个情况中点与点的对应坐标关系。 还需要注意的问题:题目要求序号尽量靠前。#include#include#include#include#include#inc... 阅读全文
posted @ 2017-09-24 17:48 primes 阅读(101) 评论(0) 推荐(0)
摘要: #include#include#include#include#include#includeusing namespace std;int n;int ans[10];int a1[]={0,31,28,31,30,31,30,31,31,30,31,30,31};int a2[... 阅读全文
posted @ 2017-09-24 17:48 primes 阅读(84) 评论(0) 推荐(0)
摘要: https://www.luogu.org/problem/show?pid=1201#sub注意的问题:送出去的钱是整数!#include#include#include#include#include#include#include using namespace std;int... 阅读全文
posted @ 2017-09-24 17:48 primes 阅读(107) 评论(0) 推荐(0)
摘要: https://www.luogu.org/problem/show?pid=3402 先看一下数据规模:n#include#include#include#include#include#includeusing namespace std;map ma; int n,m;in... 阅读全文
posted @ 2017-09-24 17:48 primes 阅读(264) 评论(0) 推荐(0)
摘要: https://www.luogu.org/problem/show?pid=3383#sub#include#include#include#include#include#include#include#define L long#define M 200000007using ... 阅读全文
posted @ 2017-09-24 17:48 primes 阅读(114) 评论(0) 推荐(0)
摘要: https://www.luogu.org/problem/show?pid=1217#sub 首先,四位的,六位的,八位的回文数一定不是质数,因为它们都是11的倍数。 此题无需打表质数,因为回文数(应该)比质数少。 枚举回文数,举例五位的:for(int d1=1;d1#inclu... 阅读全文
posted @ 2017-09-24 17:48 primes 阅读(346) 评论(0) 推荐(0)