All Projects → kmyk → Jikka

kmyk / Jikka

Licence: Apache-2.0 license
an automated solver for problems of competitive programming

Programming Languages

haskell
3896 projects
Yacc
648 projects
python
139335 projects - #7 most used programming language
C++
36643 projects - #6 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Jikka

Oj
Tools for various online judges. Downloading sample cases, generating additional test cases, testing your code, and submitting it.
Stars: ✭ 517 (+261.54%)
Mutual labels:  competitive-programming, programming-contests
Usaco
General Resources for Competitive Programming
Stars: ✭ 1,152 (+705.59%)
Mutual labels:  competitive-programming, programming-contests
Cpeditor
The IDE for competitive programming 🎉 | Fetch, Code, Compile, Run, Check, Submit 🚀
Stars: ✭ 562 (+293.01%)
Mutual labels:  competitive-programming, programming-contests
Competitive coding
This repository contains some useful codes, techniques, algorithms and problem solutions helpful in Competitive Coding.
Stars: ✭ 393 (+174.83%)
Mutual labels:  competitive-programming, programming-contests
AtCoderClans
【非公式】AtCoderがもっと楽しくなるリンク集です。有志による非公式サービス・ツール・ライブラリ・記事などをまとめています。
Stars: ✭ 74 (-48.25%)
Mutual labels:  competitive-programming, programming-contests
Usaco Guide
A free collection of curated, high-quality resources to take you from Bronze to Platinum and beyond.
Stars: ✭ 439 (+206.99%)
Mutual labels:  competitive-programming, programming-contests
Awesome Competitive Programming
💎 A curated list of awesome Competitive Programming, Algorithm and Data Structure resources
Stars: ✭ 9,119 (+6276.92%)
Mutual labels:  competitive-programming, programming-contests
FacebookHackerCup-2019
🏃 Python Solutions of All 22 Problems in FHC 2019
Stars: ✭ 15 (-89.51%)
Mutual labels:  competitive-programming, programming-contests
Programming Contest
My solutions of some problems from different online judges
Stars: ✭ 158 (+10.49%)
Mutual labels:  competitive-programming, programming-contests
Competitive Programming
My solutions to problems from various competitive programming websites.
Stars: ✭ 93 (-34.97%)
Mutual labels:  competitive-programming, programming-contests
Stopstalk Deployment
Stop stalking and start StopStalking 😉
Stars: ✭ 276 (+93.01%)
Mutual labels:  competitive-programming, programming-contests
GoogleCodeJam-2017
🏃 Python Solutions of All 27 Probelms in GCJ 2017
Stars: ✭ 53 (-62.94%)
Mutual labels:  competitive-programming, programming-contests
yukicoder-problems
Problem manager for yukicoder users
Stars: ✭ 12 (-91.61%)
Mutual labels:  competitive-programming, programming-contests
Domjudge
DOMjudge programming contest jury system
Stars: ✭ 484 (+238.46%)
Mutual labels:  competitive-programming, programming-contests
togasat
A Header-Only CDCL SAT Solver for Programming Contest
Stars: ✭ 51 (-64.34%)
Mutual labels:  competitive-programming, programming-contests
Atcoderproblems
Extend your AtCoder
Stars: ✭ 713 (+398.6%)
Mutual labels:  competitive-programming, programming-contests
verification-helper
a testing framework for snippet libraries used in competitive programming
Stars: ✭ 137 (-4.2%)
Mutual labels:  competitive-programming, programming-contests
GoogleCodeJam-2016
🏃 Python Solutions of All 26 Problems of GCJ 2016
Stars: ✭ 18 (-87.41%)
Mutual labels:  competitive-programming, programming-contests
E Maxx Eng
Translation of http://e-maxx.ru into English
Stars: ✭ 1,238 (+765.73%)
Mutual labels:  competitive-programming, programming-contests
BAPCtools
Tools for developing ICPC-style programming contest problems.
Stars: ✭ 36 (-74.83%)
Mutual labels:  competitive-programming, programming-contests

Jikka

test

Jikka is an automated solver for problems of competitive programming.

In competitive programming, there are some problems that can be solved just by repeating formula transformations or by pasting snippets of famous data structures. Jikka solves such problems automatically. Jikka takes problems as input in the form of programs of a very restricted subset of Python, optimizes the codes to reduce their computational complexity, and converts them to implementations of C++ for output. / 競技プログラミングにおいて「ただ式変形をするだけで解ける」「ただデータ構造のライブラリを貼るだけで解ける」問題は実は少なくありません。 Jikka はそのような問題を自動で解いてくれます。 Jikka は問題をとても制限された Python のサブセット言語のコードの形で入力として受け取り、計算量を落とすような最適化を行い、C++ の実装に変換して出力します。

Try on Web

Go https://kmyk.github.io/Jikka/playground.

Usage

$ jikka convert PYTHON_FILE

How to Install

Using prebuilt binaries (recommended)

Go Releases page and download jikka-vA.B.C.D-Linux, jikka-vA.B.C.D-maxOS or jikka-vA.B.C.D-Windows.exe.

Using Stack

Stack is required. If you are using Ubuntu, you can install Stack with $ sudo apt install haskell-stack.

$ git clone https://github.com/kmyk/Jikka.git
$ cd Jikka
$ stack install

Using Cabal

Cabal is required. This is bundled Haskell Platform. If you are using Ubuntu, you can install Stack with $ sudo apt install haskell-platform.

$ cabal update
$ cabal install Jikka

Discussions

Please feel free to use our GitHub Discussions. / GitHub Discussions があるので気軽に使ってください。

Documents

For users:

For developpers:

Blog articles:

Examples

examples/fib.py (v5.0.5.0)

Input, O(N):

def f(n: int) -> int:
    a = 0
    b = 1
    for _ in range(n):
        c = a + b
        a = b
        b = c
    return a

def solve(n: int) -> int:
    return f(n) % 1000000007

Output, O(log N):

#include "jikka/all.hpp"
#include <algorithm>
#include <cstdint>
#include <functional>
#include <iostream>
#include <numeric>
#include <string>
#include <tuple>
#include <vector>
int64_t solve(int64_t n_317) {
  return jikka::modmatap<2, 2>(
      jikka::modmatpow<2>(jikka::make_array<std::array<int64_t, 2>>(
                              jikka::make_array<int64_t>(1, 1),
                              jikka::make_array<int64_t>(1, 0)),
                          n_317, 1000000007),
      jikka::make_array<int64_t>(1, 0), 1000000007)[1];
}
int main() {
  int64_t x318;
  std::cin >> x318;
  int64_t x319 = solve(x318);
  std::cout << x319;
  std::cout << '\n';
}

examples/static_range_sum.py (v5.0.10.0)

Input, O(N^2):

# https://judge.yosupo.jp/problem/static_range_sum

from typing import *

def solve(n: int, q: int, a: List[int], l: List[int], r: List[int]) -> List[int]:
    ans = [-1 for _ in range(q)]
    for i in range(q):
        ans[i] = sum(a[l[i]:r[i]])
    return ans

def main() -> None:
    n, q = map(int, input().split())
    a = list(map(int, input().split()))
    assert len(a) == n
    l = list(range(q))
    r = list(range(q))
    for i in range(q):
        l[i], r[i] = map(int, input().split())
    ans = solve(n, q, a, l, r)
    for i in range(q):
        print(ans[i])

if __name__ == '__main__':
    main()

Output, O(N):

#include <algorithm>
#include <cstdint>
#include <functional>
#include <iostream>
#include <numeric>
#include <string>
#include <tuple>
#include <vector>
std::vector<int64_t> solve(int64_t n_0, int64_t q_1, std::vector<int64_t> a_2,
                           std::vector<int64_t> l_3, std::vector<int64_t> r_4) {
  std::vector<int64_t> x6 = std::vector<int64_t>(a_2.size() + 1);
  x6[0] = 0;
  for (int32_t i7 = 0; i7 < int32_t(a_2.size()); ++i7) {
    x6[(i7 + 1)] = x6[i7] + a_2[i7];
  }
  std::vector<int64_t> x5 = x6;
  std::vector<int64_t> x10 = std::vector<int64_t>(q_1);
  for (int32_t i11 = 0; i11 < int32_t(q_1); ++i11) {
    x10[i11] = -x5[l_3[i11]] + x5[r_4[i11]];
  }
  return x10;
}
int main() {
  int64_t n_13 = -1;
  int64_t q_14 = -1;
  std::cin >> n_13;
  std::vector<int64_t> a_15 = std::vector<int64_t>(n_13, -1);
  std::cin >> q_14;
  std::vector<int64_t> l_16 = std::vector<int64_t>(q_14, -1);
  std::vector<int64_t> r_17 = std::vector<int64_t>(q_14, -1);
  for (int32_t i18 = 0; i18 < n_13; ++i18) {
    std::cin >> a_15[i18];
  }
  for (int32_t i_19 = 0; i_19 < q_14; ++i_19) {
    std::cin >> l_16[i_19];
    std::cin >> r_17[i_19];
  }
  for (int32_t i_20 = 0; i_20 < q_14; ++i_20) {
  }
  auto ans_21 = solve(n_13, q_14, a_15, l_16, r_17);
  for (int32_t i_22 = 0; i_22 < q_14; ++i_22) {
  }
  for (int32_t i_23 = 0; i_23 < q_14; ++i_23) {
    std::cout << ans_21[i_23] << ' ';
    std::cout << '\n' << ' ';
  }
}

License

Appache License 2.0

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].