This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <cstdio> | |
| #include <cstring> | |
| #include <algorithm> | |
| #include <set> | |
| #include <map> | |
| #include <queue> | |
| #include <vector> | |
| #include <cassert> | |
| using namespace std; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <cstdio> | |
| #include <cstring> | |
| #include <algorithm> | |
| #include <set> | |
| #include <map> | |
| #include <queue> | |
| #include <vector> | |
| #include <cassert> | |
| using namespace std; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <cstdio> | |
| #include <cstring> | |
| #include <cmath> | |
| #include <algorithm> | |
| #include <stack> | |
| #include <queue> | |
| #include <string> | |
| #include <vector> | |
| #include <set> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <bits/stdc++.h> | |
| using namespace std; | |
| typedef long long LL; | |
| const int N = 100005; | |
| int ca; | |
| char str[N]; | |
| int n; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cstdio> | |
| #include <iostream> | |
| #include <cstring> | |
| #include <algorithm> | |
| using namespace std; | |
| const int N = 500005; | |
| struct Node { | |
| Node *ch[2] , *p; | |
| int size; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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: |