自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(97)
  • 收藏
  • 关注

原创 我太难了

9.1大逃离 (开始不会)在int main()里面定义变量要赋初始值0;变量搞混 弄乱了什么时候%k什么时候%mod9.2垃圾陷阱 没有看懂9.3传球游戏 环的问题有时候再接一份有时候不用接接苹果 特殊状态9.4月赛读题9.7神仙博客!https://blog.youkuaiyun.com/weixin_42264485/article/details...

2019-10-06 17:06:52 199

原创 【luoguP3258】松鼠的新家

树上差分注意倍增的时候循环是1开始还是0开始树上差分过程总结建树 求f 求lca dfs把子树和给根节点#include<iostream>#include<cstring>#include<fstream>#include<cstdio>using namespace std;const int maxn=3000...

2019-05-12 10:20:45 191

原创 【luoguP2879】 区间统计

差分 map关于map:两个头文件详见代码 要放在using namespace std的后面否则开不了 用法是 map<键类型, 值类型> 当两个数重复不能都存进去#include<iostream>#include<cstdio>#include<cmath>#include<algorithm>#inclu...

2019-05-12 08:43:10 186

原创 【bzoj2054】 疯狂的馒头

附https://blog.youkuaiyun.com/aarongzk/article/details/51661600#commentBox为什么能跳过染完的区间 因为用了find(x)!#include<iostream>#include<cstdio>#include<cstdlib>#include<cmath>#incl...

2019-05-10 17:26:30 188

原创 P1197 星球大战

关于这个题是怎么卡住的:1:当判断两个点在不在一个根节点下时 不能看fa[x]是否等于fa[y] 要用find(x)是否等于find(y)2:关于思路实现 统计联通块个数的时候不用循环看有几种fa 当联入一个新点 如果祖先不同就会少一个联通块!#include<iostream>#include<cstdio>#include<cstring>...

2019-05-10 15:15:58 218

原创 清北第五套

三角形自己做不出来主要是没有注意到一个三角形会被三条唯一确定 三条唯一确定一个三角形因此C(n,3)-C(一类平行线个数,2)*余下-C(一类平行线个数,3)总 - 平行线选两条都不与第三条成三角形 - 平行线选三条也不能组成三角形#include<iostream>#include<cstdio>#include<cmath&...

2019-05-08 10:53:19 144

原创 清北第四套

transact业务办理一个{ai}已经排好 最后一个人要经历所有时间 等待时间要很大好吧我也不知道为啥贪心……传球接力附https://blog.youkuaiyun.com/no1_terminator/article/details/53206706...

2019-05-07 16:57:28 101

原创 清北第三套

铺瓷砖推过程没有推到最简……小y的问题bb想成了b[i]……#include<iostream>#include<cstdio>#include<cstring>#include<cmath>#include<algorithm>using namespace std;#define ll long long...

2019-05-07 16:54:22 139

原创 清北第二套

迷一个字符 它可以用作字符 也可以自动就用作它的编码关于明文和密文的对应细节:(老想起密码子和反密码子……想广红女神)密文明文不能对应多个 一共26个字母 如果用了25个 剩下一个自动对应#include<iostream>#include<cstdio>#include<cmath>#include<cstring>#in...

2019-05-06 15:26:44 277

原创 清北第一套

算等比数列求和惊:除法不能取模!!!求逆元!!!(您的费马小定理~)游稍加分析发现有 一条路走到黑 的路只走了一次 其余两次sum*2-mx运……(您的好友已下线)...

2019-05-06 15:13:33 191

原创 nowadays //树状数组

P1583有点乱 俺又弄不清楚题了#include<iostream>#include<cstdio>#include<cmath>#include<algorithm>#include<cstring>using namespace std;int e[100000];int n,k;struct matrix{ ...

2019-05-03 17:38:21 131

原创 DAY3

比较 C(n1,m1) 和 C(n2,m2) 的大小关系

2019-04-06 20:11:51 169

原创 DAY2

数论<质数>确定性判质数O(sqrt(n))Miller Robbinint gg[8] = {2,3,5,7,13,29,37,89};bool miller_rabin(int a,int n){ int d=n-1,r=0; while (d%2==0) d/=2,r++; int x = kuaisumi(a,d,n); if (x==1) ...

2019-04-05 11:32:02 242

原创 DAY1

上午题前~#include<iostream>#include<cstdio>#include<cmath>#include<cstring>#include<algorithm>using namespace std;typedef long long ll;typedef long double ld;#def...

2019-04-04 20:16:03 370

原创 【数学旅资料】 《四月是你的谎言》

已至四月夙夜忧昧 爷娘愁容 纸笔缱绻 奈何时过境迁 昔人不荣 乃颦颦蹙蹙 辗转踟蹰 今附资料一手 纵无所用 吾心甚蔚 逆风解意 怜恋春颜“你是一树一树的花开 是燕在梁间的呢喃 你是爱 是暖 是希望 你是人间四月天” ...

2019-04-02 15:52:41 313

原创 计数

整除分块http://www.cnblogs.com/peng-ym/p/8661118.html gg21莫比乌斯反演http://www.cnblogs.com/peng-ym/p/8647856.html模意义下的组合数计算(卢卡斯定理)https:...

2019-04-02 11:21:09 139

原创 【luoguP1582】

二进制题???我们发现(谁知道咋发现的……)你有a个瓶子 那么你最多能合成num个瓶子 num=a转化成二进制的1的个数你想要b个瓶子 如果num<=b 你可以自力更生艰苦创业不需要别的瓶子如果num>b 你需要在a的二进制中消1你不知道的事: i&-i是指从后往前数,到第一个1出现为止的数(二进制下) int work(in...

2019-04-02 10:52:33 127

原创 【luogu5091】欧拉定理板子

求phi(敲黑板)#include <iostream>#include <cstdio>using namespace std;int a,b,m,temp,phi,ans=1;bool flag;int main(){ int i; char c; scanf("%d%d",&a,&m); temp=p...

2019-04-02 10:46:01 112

原创 【中国剩余定理板子】

void exgcd(int a,int b,int &x,int &y) { if(b==0) { x=1;y=0;return ; } exgcd(b,a%b,x,y); int tp=x; x=y; y=tp-a/b*y;}int china() { int ans=0,lcm=1,x,y; for(int i=1;i<=k;i++) lcm*...

2019-04-02 10:40:43 308

原创 【luoguP4942】

第一思路高精度那就看看范围好了暴力超时无疑 模9赠你天机!你不知道的事: 一个数字除以9的余数等于它的各位数字之和除以9的余数 为么呢 因为10%9==1所以例如 1 2 3 4 5 6 7 8 这一串数和%9==12 34 56 78的和%9 (a*10)%9对a%9没有影响要求l到r的和 等差数列求和公式!!!注意(l+...

2019-04-02 08:57:51 176

原创 【luoguP2421】 扩欧

https://www.cnblogs.com/acfunction/p/8858577.html#include<iostream>#include<cstdio>#include<algorithm>#include<cmath>#include<cstring>using namespace std;int n,...

2019-04-01 11:35:42 121

原创 【欧拉 积性 逆元 费马 行列式 欧几里得 中国剩余定理 贝祖】

欧拉https://blog.youkuaiyun.com/liuzibujian/article/details/81086324 gg21 https://www.cnblogs.com/wangxiaodai/p/9758242.html积性https://blog.youkuaiyun.com/skywalkert/article/details/50...

2019-03-31 11:34:38 157

原创 【矩阵加减乘】

矩阵加法就是相同位置的数字加一下。矩阵减法也类似。矩阵乘以一个常数,就是所有位置都乘以这个数。但是,等到矩阵乘以矩阵的时候,一切就不一样了。这个结果是怎么算出来的?教科书告诉你,计算规则是,第一个矩阵第一行的每个数字(2和1),各自乘以第二个矩阵第一列对应位置的数字(1和1),然后将乘积相加( 2 x 1 + 1 x 1),得到结果矩阵左上角的那个值3。也就...

2019-03-31 09:57:52 4732 1

原创 【筛素数】

埃式筛法int prime[MAXN];//第i个素数bool is_pri[MAXN+10];//is_pri[i]表示i是素数//返回n以内素数的个数int sieve(int n){int p=0;for(int i=0;i<=n;i++)is_pri[i]=true;is_pri[0]=is_pri[1]=false;for(int i=2;i<=n;i+...

2019-03-31 09:47:50 303

原创 【快速幂】【最大公约数】

#include<iostream>#include<cstdio>using namespace std;int n,k;void quc() { int ans=1; while(k>0) { if(k%2==1) ans*=n; n=n*n; k/=2; } cout<<ans;}int main() { cin&...

2019-03-31 09:35:16 149

原创 【高精度】

输入void intt (int a[]){ string s; cin>>s; a[0]=s.length(); for(int i=1;i<=a[0];i++) a[i]=s[a[0]-i]-'0';} 倒叙存了储位数确定 即字符串长度进位借位加法c[i]=a[i]+b[i];if(c[i]&g...

2019-03-31 09:07:37 112

原创 【luoguP1218】

果断dfs#include<iostream>#include<cstdio>#include<cmath>#include<algorithm>#include<cstring>using namespace std;int n,a=0;int b=13939133,cnt;bool pr[100000009];...

2019-03-28 21:00:07 96

原创 【luoguP1217】 回文质数

题目名称概括所有 ………………判断质数+判断回文听说此范围和打表更配欧…判断质数当然要埃式筛法啦关于这个判断回文emmm……最开始想借数组 费事have a lookbool isHWS(int num) { int temp=num,ans=0; while (temp!=0) { ans=ans*10+temp%10; ...

2019-03-28 20:05:08 246

原创 【luogu1214】

#include<iostream>#include<cstdio>#include<algorithm>#include<cmath>using namespace std;int n,m,p=0,cnt;int ans[100000];int f[5000][5000];struct utt{ int a; int b;}...

2019-03-27 17:31:51 90

原创 【luogu1215】

看题解之前谁倒给谁捋不清楚………………捋清楚思路开始暴搜A可以倒给B和CB可以倒给A和CC可以倒给A和B注意避免死循环#include<iostream>#include<cstdio>#include<cmath>#include<cstring>#include<algorithm>using na...

2019-03-27 16:59:23 88

原创 【luoguP5269】 longlong惨案

大模拟没开longlong见祖宗!#include<iostream>#include<cstdio>#include<cstring>#include<cmath>#include<algorithm>using namespace std;long long t,n,l,r,c,x,y,k;long long ...

2019-03-24 15:42:37 116

原创 【洛谷P3864】命名那个数字 关于字符

关于这道P3846夺走你的老命命名那个数字 首先读题就读不懂……好不容易读懂题思路还好就是太难写了…………见暴力题解…………#include<bits/stdc++.h>using namespace std;vector<string> Dict; //用Dict存放所有字典中的名字string str; //给定的编号const char ...

2019-03-21 21:27:27 345

原创 清北第一套

T1 算用等比数列求和公式??惊!?!?!?T2(省略分析)因此ans=距离之和*2-最短路最…短…路……?!?!??

2019-03-20 17:25:51 105

原创 【2011D2】

T1 factorl*l%mo容易溢出惊!#include<iostream>#include<cstdio>#include<cmath>#include<cstring>#include<algorithm>using namespace std;const int mo=10007;int a,b,k,...

2019-03-20 11:25:29 105

原创 【2011D1】

T1 铺地毯#include<iostream>#include<cstdio>#include<cmath>#include<cstring>#include<algorithm>using namespace std;int n,fx,fy,flag;struct mp { int x,y; int l...

2019-03-19 11:13:25 118

原创 【luoguP1031】均分纸牌 贪心

关于我的纸牌经历了什么……坑点:只能左右移动 因此如果当前a[i]==average当m==0 cnt不加 当m!=0 cnt加#include<iostream>#include<cstdio>#include<cstring>using namespace std;int n,a[10000];int sum,ev,m,cnt,...

2019-03-18 20:19:58 119

原创 【loj10016】灯泡 三分

https://blog.youkuaiyun.com/zhangjianjunab/article/details/83410772惊!???!?!?

2019-03-18 19:45:52 201

原创 【luoguP1080】国王游戏 贪心

举例分析局部规律推整体规律https://www.cnblogs.com/olinr/p/9535110.html

2019-03-18 19:44:56 298

原创 NOT YET

天天爱跑步灯泡传送带愤怒的小鸟

2019-03-18 19:05:29 559

原创 【luoguP1661】扩散 二分

初始思路 模拟正 二分见洛谷第一篇题解#include&lt;iostream&gt;#include&lt;cstdio&gt;#include&lt;cmath&gt;using namespace std;int xs[51];int ys[51];//坐标int ints[51];//并查集int find(int n){ if(ints[n]==n)r...

2019-03-17 16:38:28 226

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除