All Projects → google → ac-library.cr

google / ac-library.cr

Licence: Apache-2.0 license
Port of ac-library implemented in Crystal Programming Language

Programming Languages

crystal
512 projects
shell
77523 projects

Projects that are alternatives of or similar to ac-library.cr

ac-library-rb
a Ruby port of AtCoder Library (ACL).
Stars: ✭ 50 (+78.57%)
Mutual labels:  atcoder, atcoder-library, ac-library
icie
Competitive programming IDE-as-a-VS-Code-plugin
Stars: ✭ 81 (+189.29%)
Mutual labels:  competitive-programming, atcoder
Code
Macesuted's Code Repository.
Stars: ✭ 20 (-28.57%)
Mutual labels:  competitive-programming, atcoder
cppdump
Standard dumps of data structures/algorithms
Stars: ✭ 18 (-35.71%)
Mutual labels:  competitive-programming, atcoder
CP
Competitive Coding
Stars: ✭ 25 (-10.71%)
Mutual labels:  competitive-programming, atcoder
category-wise-problems
contains category wise problems(data structures, competitive) of popular platforms.
Stars: ✭ 32 (+14.29%)
Mutual labels:  competitive-programming, atcoder
harwest-tool
A one-shot tool to harvest submissions from different OJs onto one single VCS managed repository http://bit.ly/harwest
Stars: ✭ 89 (+217.86%)
Mutual labels:  competitive-programming, atcoder
Resources
Data Structures, Algorithms, Utility Classes for Competitive Programming, Codeforces: https://codeforces.com/profile/wleung_bvg, AtCoder: https://atcoder.jp/users/wleung_bvg, DMOJ: https://dmoj.ca/user/wleung_bvg
Stars: ✭ 34 (+21.43%)
Mutual labels:  competitive-programming, atcoder
AtCoderClans
【非公式】AtCoderがもっと楽しくなるリンク集です。有志による非公式サービス・ツール・ライブラリ・記事などをまとめています。
Stars: ✭ 74 (+164.29%)
Mutual labels:  competitive-programming, atcoder
Competetive programming
Contains my solutions to thousands of different CP sums and some DSA Problems(available in snippets)
Stars: ✭ 21 (-25%)
Mutual labels:  competitive-programming, atcoder
Competitive-Programming--Solution
This ia an public repository for Accepted solution of coding problems on different coding plateforms like codeforces , hackerearth, codechef , hackerrank .......
Stars: ✭ 24 (-14.29%)
Mutual labels:  competitive-programming
CodingNinjas-Eminence-CP-2018-
Repository for course EMINENCE 2018 by coding ninjas .
Stars: ✭ 39 (+39.29%)
Mutual labels:  competitive-programming
fridge
Fridge for Codechef: An android app for downloading and browsing questions and contests from codechef.com offline
Stars: ✭ 17 (-39.29%)
Mutual labels:  competitive-programming
SeptoCode-21
This September, get ready to beat your brains out for the GDSC Club. Starting from 20th September, all the contributors will be provided with simple programming questions,one per day, which can be written using any programming language of preference. The submissions will be accepted through Google Forms after thorough checking.
Stars: ✭ 20 (-28.57%)
Mutual labels:  competitive-programming
python-cp-cheatsheet
Python3 interview prep cheatsheet and examples
Stars: ✭ 407 (+1353.57%)
Mutual labels:  competitive-programming
CS-97SI
Solutions to "CS 97SI: Introduction to Competitive Programming Contests" by Stanford University
Stars: ✭ 24 (-14.29%)
Mutual labels:  competitive-programming
The-CP-Companion
Your ultimate destination for Competitive Coding this Hacktoberfest21
Stars: ✭ 21 (-25%)
Mutual labels:  competitive-programming
DSA-Path-And-Important-Questions
I am planning to add a beginner friendly path for my Juniors to Learn DSA and I will try to provide solutions of every problem also. We can add codeChef Challenge solutions also
Stars: ✭ 35 (+25%)
Mutual labels:  competitive-programming
GoogleCodeJam-2017
🏃 Python Solutions of All 27 Probelms in GCJ 2017
Stars: ✭ 53 (+89.29%)
Mutual labels:  competitive-programming
Competitive-programing
This repository is for encouraging people in competitive programming. And making PR's on a regular basis. Through this repo, Geeks can find solutions for various programming problems and also give your code to increase the repo.
Stars: ✭ 20 (-28.57%)
Mutual labels:  competitive-programming

ac-library.cr Run test and verifier

This is not an officially supported Google product.

ac-library.cr is a Crystal port of ac-library.

This library aims to provide the almost-equivalent (and additional) functionality with ac-library but in the manner of Crystal.

ModInt.cr (<atcoder/modint>)

  • modint => Unimplemented

  • modint998244353 => AtCoder::ModInt998244353

  • modint1000000007 => AtCoder::ModInt1000000007

    alias Mint = AtCoder::ModInt1000000007
    Mint.new(30_i64) // Mint.new(7_i64) #=> 285714292
  • static_modint => AtCoder.static_modint

    AtCoder.static_modint(ModInt101, 101_i64)
    alias Mint = AtCoder::ModInt101
    Mint.new(80_i64) + Mint.new(90_i64) #=> 89
  • dynamic_modint => Unimplemented

FenwickTree.cr (<atcoder/fenwicktree>)

  • fenwick_tree<T> fw(n) => AtCoder::FenwickTree(T).new(n)

  • fenwick_tree<T> fw(array) => AtCoder::FenwickTree(T).new(array)

    tree = AtCoder::FenwickTree(Int64).new(10)
    tree.add(3, 10)
    tree.add(5, 20)
    tree[3..5] #=> 30
    tree[3...5] #=> 10
    • .add(p, x) => #add(p, x)
    • .sum(l, r) => #[](l...r)

SegTree.cr (<atcoder/segtree>)

  • segtree<S, op, e> seg(v) => AtCoder::SegTree(S).new(v, &op?)

    単位元は暗黙的にnilで定義されるため使用する際に定義する必要はありません。逆に言えばモノイドの (単位元以外の) 元にnilを含めることはできません。 The identity element will be implicitly defined as nil, so you don't have to manually define it. In the other words, you cannot include nil into an element of the monoid.

    tree = AtCoder::SegTree.new((0...100).to_a) {|a, b| [a, b].min}
    tree[10...50] #=> 10
    • .set(p, x) => #[]=(p, x)
    • .get(p) => #[](p)
    • .prod(l, r) => #[](l...r)
    • .all_prod() => #all_prod
    • .max_right<f>(l) => Unimplemented
    • .max_left<f>(r) => Unimplemented

LazySegTree.cr (<atcoder/lazysegtree>)

  • lazy_segtree<S, op, e, F, mapping, composition, id> seg(v) => AtCoder::LazySegTree(S, F).new(v, op, mapping, composition)

    単位元は暗黙的にnilで定義されるため使用する際に定義する必要はありません。逆に言えばモノイドの (単位元以外の) 元にnilを含めることはできません。 The identity element will be implicitly defined as nil, so you don't have to manually define it. In the other words, you cannot include nil into an element of the monoid.

    また、恒等写像は暗黙的にnilで定義されるため使用する際に定義する必要はありません。逆に言えばFの (恒等写像以外の) 元にnilを含めることはできません。 Similarly, the identity map of F will be implicitly defined as nil, so you don't have to manually define it. In the other words, you cannot include nil into an element of the set F.

    op = ->(a : Int32, b : Int32) { [a, b].min }
    mapping = ->(f : Int32, x : Int32) { f }
    composition = ->(a : Int32, b : Int32) { a }
    tree = AtCoder::LazySegTree(Int32, Int32).new((0...100).to_a, op, mapping, composition)
    tree[10...50] #=> 10
    tree[20...60] = 0
    tree[50...80] #=> 0
    • .set(p, x) => Unimplemented
    • .get(p) => #[](p)
    • .prod(l, r) => #[](l...r)
    • .all_prod() => #all_prod
    • .apply(p, f) => #[]=(p, f)
    • .apply(l, r, f) => #[]=(l...r, f)
    • .max_right<f>(l) => Unimplemented
    • .max_left<f>(r) => Unimplemented

DSU.cr (<atcoder/dsu>)

  • dsu(n) => AtCoder::DSU.new(n)

    dsu = AtCoder::DSU.new(10)
    dsu.merge(0, 2)
    dsu.merge(4, 2)
    dsu.same(0, 4) #=> true
    dsu.size(4) #=> 3
    • .merge(a, b) => #merge(a, b)

    • .same(a, b) => #same(a, b)

    • .leader(a) => #leader(a)

    • .size() => #size

    • .groups() => #groups

      • This method returns set instead of list.

MaxFlow.cr (<atcoder/maxflow>)

  • mf_graph<Cap> graph(n) => AtCoder::MaxFlow.new(n)

    Cap is always Int64.

    mf = AtCoder::MaxFlow.new(3)
    mf.add_edge(0, 1, 3)
    mf.add_edge(1, 2, 1)
    mf.add_edge(0, 2, 2)
    mf.flow(0, 2) #=> 3
    • .add_edge(from, to, cap) => #add_edge(from, to, cap)
    • .flow(s, t) => #flow(s, t)
    • .min_cut(s) => Unimplemented
    • .get_edge(i) => Unimplemented
    • .edges() => Unimplemented
    • .change_edge(i, new_cap, new_flow) => Unimplemented

SCC.cr (<atcoder/scc>)

  • scc_graph graph(n) => AtCoder::SCC.new(n)

    scc = AtCoder::SCC.new(3_i64)
    scc.add_edge(0, 1)
    scc.add_edge(1, 0)
    scc.add_edge(2, 0)
    scc.scc #=> [Set{2}, Set{0, 1}]
    • .add_edge(from, to) => #add_edge(from, to)
    • .scc() => #scc

TwoSat.cr (<atcoder/twosat>)

  • two_sat graph(n) => AtCoder::SCC.new(n)

    twosat = AtCoder::TwoSat.new(2_i64)
    twosat.add_clause(0, true, 1, false)
    twosat.add_clause(1, true, 0, false)
    twosat.add_clause(0, false, 1, false)
    twosat.satisfiable? #=> true
    twosat.answer #=> [false, false]
    • .add_clause(i, f, j, g) => #add_clause(i, f, j, g)

    • .satisfiable() => #satisfiable?

    • .answer() => #answer

      This method will raise if it's not satisfiable

Math.cr (<atcoder/math>)

  • pow_mod(x, n, m) => AtCoder::Math.pow_mod(x, n, m)
  • inv_mod(x, m) => AtCoder::Math.inv_mod(x, m)
  • crt(r, m) => AtCoder::Math.crt(r, m)
  • floor_sum => AtCoder::Math.floor_sum(n, m, a, b)

PriorityQueue.cr (not in ACL)

  • AtCoder::PriorityQueue(T).new

    q = AtCoder::PriorityQueue(Int64).new
    q << 1_i64
    q << 3_i64
    q << 2_i64
    q.pop #=> 3
    q.pop #=> 2
    q.pop #=> 1
    • #<<(v : T)

      Push value into the queue.

    • #pop

      Pop value from the queue.

    • #size

      Returns size of the queue

Prime.cr (not in ACL)

  • AtCoder::Prime (module)

    Implements Ruby's Prime library.

    AtCoder::Prime.first(7) # => [2, 3, 5, 7, 11, 13, 17]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].