随笔分类 - 模板
摘要:#include using namespace std; int main(){ int l=1,r=n+1,mid,k; while (l+1>1; if (solve(mid)<=k) l=mid; else r=mid; } printf("%d",l); return 0; }
阅读全文
摘要:#include using namespace std; const int P=1000000007; struct nob{ int to,jump,val,cost; }a[500000]; int n,m,s,t,tot=1,jump[500000]={0}; int len[10005],line[1000005]; bool judge[10005]; inline int...
阅读全文
摘要:震惊,照着SYCstudio的教程打出来的Dinic竟被呆滞怒斥是EK,惊了,打开教程的方式可能跟呆滞不太一样。
阅读全文
摘要:啊哈哈哈哈,我胡汉三终于又回来啦!带来noip之后的第一篇博客,虽然是一篇模板,那就是马拉车当当当。 我知道你们肯定很聪明的,会自己去找教程的
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; struct edge{ int sta,ed,val,jump; }a[1000005]; int n,m,jump[1000005],tot,line[1000005],point[1000005],jud
阅读全文
摘要:滑稽滑稽,这次我们来讲讲线性筛素数,让我们先上代码。 嗯,好接下来我们来看一下这个代码,意外的很短,但是理解起来还是有点难度的,但是其实重点就只是在那一条蓝色的语句上。为什么当i是sushu[l]的倍数时就break呢? 证: ∵ i%sushu[l]==0 ∴ i=k*sushu[l] ∴ i*s
阅读全文
摘要:这个树剖的代码写的我好绝望啊……两棵树傻傻搞不清。 写了两天的树剖 我脑子都快被剖开来了!!! (超级想要引用这句话的,充分体现了我的绝望) 好,怒吼完毕,接下来来讲一下代码。(现在想想搞树剖也许是一个错误的决定,要不是因为某天天爱跑步我才不会来搞树剖呢)其实这个树剖把……思想是挺简单的,但是主要是
阅读全文
摘要:inline int read(){ int rem=0,f=1; char cha=getchar(); while(cha>'9'||cha<'0'){ if(cha=='-'){ f=-1; } cha=getchar(); } while(cha<='9'&&cha>='0'){ rem=r
阅读全文
摘要:n个节点,m个询问,root为根节点,fa[i][j]表示i的第2j个祖先
阅读全文
摘要:n个点,m条有向边(color相同的就可以缩成一个点了)
阅读全文
摘要:没错是的,终于是放下了心中的一块石头,过了初赛了。庆祝一下庆祝一下。好,那不说废话,上主题。主席树,问题是有T个序列,每个序列分别有ni个数对于每个序列mi次询问,每次询问有l,r,k,表示求在序列中l到r区间的第k大的数输入:第一行T表示有T个序列,然后有n,m分别表示序列有n个数,m次询问,接下
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; struct nob{ int fail,son[27],ed; }a[1000000]; int cnt=0; void build (string s){ int now=0; for (int i=0;
阅读全文
摘要://你的任务只需要生成10个in文件(从data0.in到data9.in)。 #include <bits/stdc++.h> using namespace std; void makedata(int t) { cerr<<"test:"<<t<<endl; char input[20]; s
阅读全文
摘要:感觉是一个极其丑陋而且比较慢的(应该吧,因为看起来比较慢)矩乘。QAQ
阅读全文
摘要:#include using namespace std; const int INF=0x3f3f3f3f; const int maxn=600010; struct point{ int start,cost; }; bool operator n.cost; } struct edge{ int to,cost; }; vector e[maxn]; bool judg...
阅读全文
摘要:#include using namespace std;int n,m,mp[1001][1001],s[1001]; bool judge[1001]={0}; //judge表示判断点是否有用过,s[i]表示1到点i的最短路径,mp表示两点的距离int main(){ cin>>n>>m; for (int i=1; i>x>>y>>z; mp[x][y]=z; } for ...
阅读全文

浙公网安备 33010602011771号