摘要:
这可以缩减代码量 增强可读性(明明是装逼) 上面两段的代码是一样的效果 同样可以这样 这样比cmath库的要快 Max 和 Min 就可以跨越 类型的限制 阅读全文
摘要:
1.为基本数据类型定义新的类型名 这是经常看到的一个东西(当然这个是偷懒专用) 就是让代码简洁 精炼一点 这句话下面,ll和long long的效果是相同的 这句话等同于 至于 define 下一篇博客会讲 2.自定义数据类型(结构体 共用体...) 比如说先定义一个结构体 那么接下来 就可以用 N 阅读全文
摘要:
string 应该是 最常用是STL容器了吧 阅读全文
摘要:
#include #include #include #include using namespace std; typedef long long ll; queue q; inline ll read () { ll x=0,f=1; char ch=getchar(); while(!isdigit(ch)) { if(ch=='-') f... 阅读全文
摘要:
#include #include #include #include using namespace std; typedef long long ll; deque d; inline ll read () { ll x=0,f=1; char ch=getchar(); while(!isdigit(ch)) { if(ch=='-') f... 阅读全文
摘要:
#include #include #include #include using namespace std; typedef long long ll; priority_queue , greater >q; //greater 从小到大排序 //less 从大到小排序 inline ll read () { ll x=0,f=1; char ch=getchar... 阅读全文
摘要:
例题 #include <bits/stdc++.h> #define rep(i,j,n) for(register int i=j;i<=n;i++) #define Rep(i,j,n) for(register int i=j;i>=n;i--) #define low(x) x&(-x) 阅读全文
摘要:
muliset就不提了 muliset 是set的“升级版” ; 定义方法 阅读全文
摘要:
例题 阅读全文
摘要:
#include <list> #include <iostream> #include <cstdio> #include <cctype> using namespace std; typedef long long ll; list < ll > l; inline ll read () { 阅读全文
该文被密码保护。 阅读全文
摘要:
前缀和 前缀和是一种很重要的思想 其实这个思想很简单 就是一次预处理 把原来O(N*M)的复杂度降到O(N+M) ∑a[i]+...+a[j]=sum[j]-sum[i-1]; 那么区间的数值查询该怎么做呢 假设有m次查询 ans=∑a[x]+...a[y]; 如上所述 ∑a[x]+...a[y]= 阅读全文