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
# 予選Aで日本人60位までが通過したという情報を元にしたランキング | |
# 日本人順位(全体順位): ハンドルネーム | |
# 通過済みの日本人順位は--としている | |
--(4): yutaka1999 | |
--(22): tozangezan | |
--(23): mcfx | |
1(24): DEGwer | |
2(32): yokozuna57 | |
3(33): sugim48 | |
--(34): kmjp |
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
import sequtils, strutils, algorithm | |
type | |
FenwickTree[T] = object | |
dat: seq[T] | |
size: int | |
initial: T | |
proc initFenwickTree[T](size: int, initial: T): FenwickTree[T] = | |
assert(size > 0) |
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; | |
#define FOR(i,s,x) for(int i=s;i<(int)(x);i++) | |
#define REP(i,x) FOR(i,0,x) | |
struct SuffixArray { | |
int N, k; | |
string S; | |
vector<int> sa, rank, tmp; |
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
import sys | |
if sys.version[0] == '2': | |
range, input = xrange, raw_input | |
def linear_recursion_solver(a, x, k, e0, e1): | |
# https://github.com/spaghetti-source/algorithm | |
def rec(k): | |
c = [e0] * n | |
if k < 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
from copy import deepcopy | |
import sys | |
if sys.version[0] == '2': | |
range, input = xrange, raw_input | |
class Matrix: | |
ZERO = 0 | |
ONE = (1 << 32) - 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; | |
#define FOR(i,s,x) for(int i=s;i<(int)(x);i++) | |
#define REP(i,x) FOR(i,0,x) | |
const int INF = 1e7; | |
template <typename T> | |
struct MinCostFlow { |
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; | |
#define FOR(i,s,x) for(int i=s;i<(int)(x);i++) | |
#define REP(i,x) FOR(i,0,x) | |
struct SuffixArray { | |
int N, k; | |
string S; | |
vector<int> sa, rank, tmp; |
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
import sys | |
import collections | |
if sys.version[0] == '2': | |
range, input = xrange, raw_input | |
class MaxFlow: | |
"""Dinic Algorithm: find max-flow | |
complexity: O(EV^2) |
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; | |
#define FOR(i,s,x) for(int i=s;i<(int)(x);i++) | |
#define REP(i,x) FOR(i,0,x) | |
#define INF 1<<29 | |
template <typename T> | |
struct MaxFlow { |
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
import collections | |
class MaxFlow: | |
"""Dinic Algorithm: find max-flow | |
complexity: O(EV^2) | |
used in GRL6A(AOJ) | |
""" | |
class Edge: | |
def __init__(self, to, cap, rev): |