摘要: 因为学习区间dp之前我会floyd,所以并不难掌握 石子合并:https://www.luogu.org/problemnew/show/P1880 区间dp要想学好,建议学习floyd 阅读全文
posted @ 2019-03-10 09:16 spytc 阅读(274) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.org/problemnew/show/P1031 题目是个水题,但是我觉得其思想还是很好的 首先是个求平均数,这个没什么好说的 其次就用了个类似差分的思想,将离平均数的个数用正负来表示,正的是需要转移给别人的,负的是需要被转移的 然后就用了前缀和,更准确来说用了 阅读全文
posted @ 2019-03-05 23:10 spytc 阅读(162) 评论(0) 推荐(0) 编辑
摘要: // luogu-judger-enable-o2 #include #define inf 500001 #define lll long long int using namespace std; long c[inf],a,n,m,k,xx,nn; int lowbit(int x){ return x&(-x);//求X二进制下从右到左第一个1的所对应的十进制下的值 } void... 阅读全文
posted @ 2019-02-24 16:02 spytc 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 当然还有 好吧是有点不太和场景,前面那么多漂亮妹纸,后面这个。。。。。。。 但我也懒得撤回了。。。 阅读全文
posted @ 2019-02-06 21:12 spytc 阅读(77) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-02-06 21:07 spytc 阅读(101) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/five20/p/7594239.html 阅读全文
posted @ 2019-02-05 23:33 spytc 阅读(83) 评论(0) 推荐(0) 编辑
摘要: #include <bits/stdc++.h>#define inf 1e9#define lll long long intusing namespace std;vector <int> q[100]; int n,rudu[100],p,ans[100],k;bool f[100];queu 阅读全文
posted @ 2019-02-05 18:27 spytc 阅读(163) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.org/problemnew/show/P1134 先贴一贴战果 14分代码 好咱们在看四十几分的 #include <bits/stdc++.h>#define inf 0x7f7fusing namespace std;long long n,m,ans,co 阅读全文
posted @ 2019-02-03 15:40 spytc 阅读(116) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/chenyufeng1991/article/details/52648523 阅读全文
posted @ 2019-02-02 20:33 spytc 阅读(272) 评论(0) 推荐(0) 编辑
摘要: ceil(x) 向上取整 ceil(9.2)=10.0 cos(x) x的余弦 cos(0.0)=1.0 exp(x) 指数函数,e的x次方 exp(1.0)=2.71828 fabs(x) x的绝对值 fabs(-5)=5 floor(x) 向下取整 floor(9.2)=9 fmod(x,y) 阅读全文
posted @ 2019-02-02 14:21 spytc 阅读(1051) 评论(0) 推荐(0) 编辑