Skip to content

Instantly share code, notes, and snippets.

View Sd-Invol's full-sized avatar

Xuanang Zhao Sd-Invol

View GitHub Profile
#include <iostream>
#include <cstdio>
#include <queue>
#include <cstring>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long LL;
const int N = 20005;
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <vector>
#include <cassert>
using namespace std;
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <vector>
#include <cassert>
using namespace std;
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <string>
#include <vector>
#include <set>
@Sd-Invol
Sd-Invol / getNearest.cpp
Created October 28, 2014 10:20
一看就懂的最近邻搜索
void getNearest(int p , int k) {
if (!p) return;
if (t[p].vis) {
LL dis = dist(P , t[p].u);
if (dis < res || (dis == res && t[p].o < t[ret].o))
res = dis , ret = p;
}
if (k) {
if (cmpY(P , t[p].u)) {
getNearest(t[p].c[0] , k ^ 1);
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 100005;
int ca;
char str[N];
int n;
int f[N] , match[N] , bel[N] , vis[N];
bool u[N] , inb[N] , g[N][N];
int Q[N] , top , bot;
void BlossomContract(int x , int y) {
memset(vis , 0 , sizeof(vis));
memset(inb , 0 , sizeof(inb));
#define pre f[match[i]]
int lca , i;
for (i = x ; i ; i = pre)
i = bel[i] , mark[i] = 1;
@Sd-Invol
Sd-Invol / sequence.cpp
Created August 16, 2015 10:47
[NOI2005]sequence.cpp
#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 500005;
struct Node {
Node *ch[2] , *p;
int size;
@Sd-Invol
Sd-Invol / hdu5002.cpp
Created August 16, 2015 14:48
Anshan2014 Online F
#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <queue>
using namespace std;
const int N = 100005;
const int INF = -1 << 30;
struct Node {
Node *ch[2] , *p , *fa;
@Sd-Invol
Sd-Invol / a.py
Last active January 2, 2016 07:06
# Python code sample
import os, re
from sys import exit
SOMECONST = None
somevariable = min(sum(1,2), max(range(10)))
def some_callable(argument1, argument2=False):
""" Doc-string for some_callable function. """
if not argument1: