板
_sophon
Brooding renders me prophetic
展开
-
快速幂模 a^b%p
经典版#include <iostream>using namespace std;typedef long long ll;ll work(ll base, ll exponent, ll mod){ ll temp = 1; while (exponent != 0) { if (exponent % 2 == 1) { exponent--; ...原创 2019-02-28 14:21:59 · 334 阅读 · 0 评论 -
Luogu P3865 【模板】ST表
原题传送门#include <bits/stdc++.h>using namespace std;inline int read(){ char c=getchar();int x=0,f=1; while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();} while(c>='0'&&...原创 2019-04-05 15:43:57 · 134 阅读 · 0 评论 -
P3372 【模板】线段树 1
原题传送门#include <bits/stdc++.h>using namespace std;const int N = 1000001;typedef long long ll;ll n,m,a[N],ans[N<<2],tag[N<<2];inline ll leftSon(ll x){ return x<<1;...原创 2019-04-05 10:11:38 · 105 阅读 · 0 评论 -
P3369 【模板】普通平衡树 STL版
原题传送门#include <iostream>#include <algorithm>#include <cstdio>#include <vector>using namespace std;vector<int> v;int main(){ ios::sync_with_stdio(false); cin.t...原创 2019-04-23 12:41:52 · 221 阅读 · 0 评论