随笔分类 - _复习
摘要:输入输出 scanf(""): d用于输入十进制数 u无符号十进制输入 o用于输入8进制数 c用于输入单个字符 s用于输入字符串(非空格开始,空格结束,字符串变量以‘0’结尾) f,lf用于输入实数,一般使用double,lf *表示对应的输入量不赋给一个变量 %*d printf("") d带符号
阅读全文
摘要:1.线段树 #include<cstdio> using namespace std; int n,p,a,b,m,x,y,ans; struct node { int l,r,w,f; }tree[400001]; inline void build(int k,int ll,int rr)//建
阅读全文
摘要:1.最小生成树 #include<iostream> #include<cstdio> #include<cstring> using namespace std; int n,m,num,head[5010],ans,dis[5010]; bool vis[5010]; struct node{
阅读全文
摘要:1.欧几里得 #include<cstdio> using namespace std; int a,b; int gcd(int x,int y){ if(y==0)return x; return gcd(y,x%y); } int main(){ scanf("%d%d",&a,&b); pr
阅读全文