NOIP模板总结 进考场先打一份缺省源: # include <cstdio> # include <iostream> # include <cstring> # include <string> # include <algorithm> # include <cmath> # define R register int # define ll long long using namespace std; int main() {…
自己敲模板还是有很多容易错的地方 写在注释里面了 LCA #include<bits/stdc++.h> #define REP(i, a, b) for(register int i = (a); i < (b); i++) #define _for(i, a, b) for(register int i = (a); i <= (b); i++) using namespace std; ; //以后MAXN改成N.因为MAXM和MAXN不容易区分 ; ]; int head[…
快排 procedure qsort(l,r:longint); var i,j,t,m:longint; begin i:=l; j:=r; m:=a[(i+j) ]; repeat while a[i]<m do inc(i); while m<a[j] do dec(j); if i<=j then begin t:=a[i]; a[i]:=a[j]; a[j]:=t; inc(i); dec(j); end; until i>j; if i<r then qsort(…