{"id":15035120,"url":"https://github.com/cheran-senthil/pyrival","last_synced_at":"2025-05-14T06:11:50.255Z","repository":{"id":40380334,"uuid":"147658180","full_name":"cheran-senthil/PyRival","owner":"cheran-senthil","description":"⚡ Competitive Programming Library","archived":false,"fork":false,"pushed_at":"2024-10-25T16:15:54.000Z","size":1109,"stargazers_count":1166,"open_issues_count":10,"forks_count":312,"subscribers_count":25,"default_branch":"master","last_synced_at":"2024-10-29T15:37:52.604Z","etag":null,"topics":["algorithms","competitive-programming","data-structures","python"],"latest_commit_sha":null,"homepage":"https://pyrival.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cheran-senthil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-06T10:36:29.000Z","updated_at":"2024-10-28T23:17:36.000Z","dependencies_parsed_at":"2023-02-01T06:15:19.920Z","dependency_job_id":"a4611dc7-a7a2-4d17-8e6a-67787823a901","html_url":"https://github.com/cheran-senthil/PyRival","commit_stats":{"total_commits":841,"total_committers":16,"mean_commits":52.5625,"dds":"0.30202140309155767","last_synced_commit":"4a735958bfd3ac130a1d60542a23390e99b756f4"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheran-senthil%2FPyRival","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheran-senthil%2FPyRival/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheran-senthil%2FPyRival/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheran-senthil%2FPyRival/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cheran-senthil","download_url":"https://codeload.github.com/cheran-senthil/PyRival/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312517,"owners_count":21082700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","competitive-programming","data-structures","python"],"created_at":"2024-09-24T20:27:34.990Z","updated_at":"2025-04-10T23:19:38.007Z","avatar_url":"https://github.com/cheran-senthil.png","language":"Python","readme":"\u003ch1 align=\"center\"\u003ePyRival\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cstrong\u003eA Python Library for Competitive Programming\u003c/strong\u003e\n\u003c/div\u003e\n\n\u003ch3 align=\"center\"\u003eDevelopers\u003c/h3\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cstrong\u003e\n    \u003ca href=\"https://github.com/Mukundan314\"\u003eMukundan314\u003c/a\u003e \u0026emsp;\n    \u003ca href=\"https://github.com/bjorn-martinsson\"\u003epajenegod\u003c/a\u003e \u0026emsp;\n    \u003ca href=\"https://github.com/eduard-netsajev\"\u003edrd93\u003c/a\u003e \u0026emsp;\n    \u003ca href=\"https://github.com/algmyr\"\u003ealgmyr\u003c/a\u003e \u0026emsp;\n    \u003ca href=\"https://github.com/meooow25\"\u003emeooow\u003c/a\u003e \u0026emsp;\n    \u003ca href=\"https://github.com/tfg50\"\u003etfg\u003c/a\u003e \u0026emsp;\n    \u003ca href=\"https://github.com/sgtlaugh\"\u003esgtlaugh\u003c/a\u003e \u0026emsp;\n    \u003ca href=\"https://github.com/abertell\"\u003eabertell\u003c/a\u003e \u0026emsp;\n  \u003c/strong\u003e\n\u003c/div\u003e\n\n---\n\n### Templates\n- The [Master Template](templates/template.py) works with all versions of Python and has Python 3 behaviour.\n- Version Specific Templates: [PyPy 2](templates/template_pypy2.py), [Python 3](templates/template_py3.py)\n\n##\n\n### Tools\n- [Interactive Runner](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/tools/interactive_runner.py)\n- [Stress Tester](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/tools/stress_tester.py)\n\n##\n\n### Snippets\n\u003cdetails\u003e\n  \u003csummary\u003eAlgebra\u003c/summary\u003e\n\n  - [(Multivariable) Chinese Remainder Theorem](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/algebra/chinese_remainder.py)\n  - [Discrete Logarithm](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/algebra/discrete_log.py)\n  - [LCM and GCD](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/algebra/gcd.py)\n  - [Integer Factorization](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/algebra/factors.py)\n  - [Fast Fourier Transform](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/algebra/fft.py)\n  - [Fast Subset Transform](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/algebra/fst.py)\n  - [Number Theoretic Transform](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/algebra/ntt.py)\n  - [Deterministic Miller-Rabin Primality Test](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/algebra/is_prime.py)\n  - [Tonelli–Shanks Algorithm](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/algebra/mod_sqrt.py)\n  - [Generalized Modular Inverse](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/algebra/modinv.py)\n  - [Euler's Phi Function](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/algebra/phi.py)\n  - [Primitive Root](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/algebra/primitive_root.py)\n  - [Sieve of Eratosthenes](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/algebra/sieve.py)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eData Structures\u003c/summary\u003e\n\n  - [Bit Array](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/data_structures/BitArray.py)\n  - [Binary Indexed (Fenwick) Tree](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/data_structures/FenwickTree.py)\n  - [Fractions](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/data_structures/Fraction.py)\n  - [Continued Fractions](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/data_structures/CFraction.py)\n  - [Disjoint-Set (Union Find) Data Structure](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/data_structures/DisjointSetUnion.py)\n  - [Generic Nodes](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/data_structures/Node.py)\n  - [Linked List](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/data_structures/LinkedList.py)\n  - [Range Query Data Structure](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/data_structures/RangeQuery.py)\n  - [(Lazy) Segment Tree](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/data_structures/LazySegmentTree.py)\n  - [Persistent Segment Tree](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/data_structures/PersistentSegTree.py)\n  - [Sorted List](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/data_structures/SortedList.py)\n  - [Treap](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/data_structures/Treap.py)\n  - [Trie Tree](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/data_structures/Trie.py)\n  - [2-satisfiability Template](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/data_structures/TwoSat.py)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eGeometry\u003c/summary\u003e\n\n  - [Convex Hull](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/geometry/convex_hull.py)\n  - [Line Functions](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/geometry/lines.py)\n  - [Polygon Functions](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/geometry/polygons.py)\n  - [Vector Functions](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/geometry/vectors.py)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eGraphs\u003c/summary\u003e\n\n  - [Bellman-Ford Algorithm](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/graphs/bellman_ford.py)\n  - [Breadth First Search](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/graphs/bfs.py)\n  - [Connected Components Search](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/graphs/components.py)\n  - [Brent's Algorithm for Cycle Detection](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/graphs/cycle_finding.py)\n  - [Depth First Search](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/graphs/dfs.py)\n  - [Dijkstra's Algorithm](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/graphs/dijkstra.py)\n  - [Eulerian Path](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/graphs/euler_walk.py)\n  - [Path Constructor](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/graphs/find_path.py)\n  - [Floyd-Warshall Algorithm](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/graphs/floyd_warshall.py)\n  - [Bipartite Graph Check](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/graphs/is_bipartite.py)\n  - [Kruskal's Algorithm with Disjoin Set Union](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/graphs/kruskal.py)\n  - [Prim's Algorithm](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/graphs/prim.py)\n  - [Tarjan's Algorithm](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/graphs/scc.py)\n  - [Topological Sorting](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/graphs/toposort.py)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eCombinatorics\u003c/summary\u003e\n\n  - [General Purpose Numbers](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/combinatorics/combinatorics.py)\n  - [Lucas's Theorem](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/combinatorics/nCr_mod.py)\n  - [Partition Function](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/combinatorics/partitions.py)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eLinear Algebra\u003c/summary\u003e\n\n  - [Matrix Arithmetic, Exponentiation, Determinant, and Inverse](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/linear_algebra/matrix.py)\n  - [Gaussian Elimination](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/linear_algebra/max_xor.py)\n  - [Multivariable Chinese Remainder Theorem](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/linear_algebra/multivariable_crt.py)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eNumerical\u003c/summary\u003e\n\n  - [Linear Recurrence Template](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/numerical/berlekamp_massey.py)\n  - [Hill Climbing Algorithm](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/numerical/hill_climbing.py)\n  - [Approximate Integration](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/numerical/integrate.py)\n  - [Polynomial Interpolation](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/numerical/interpolate.py)\n  - [Integer Roots](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/numerical/iroot.py)\n  - [Binary Search](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/numerical/search.py)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eStrings\u003c/summary\u003e\n\n  - [Knuth–Morris–Pratt Algorithm](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/strings/kmp.py)\n  - [Longest Common/Palindromic Subsequences](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/strings/lcs.py)\n  - [Longest Common Substring](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/strings/LCSubstr.py)\n  - [Longest Palindromic Substring](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/strings/LPSubstr.py)\n  - [Manacher's Algorithm](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/strings/suffix_array.py)\n  - [Lyndon Factorization](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/strings/min_rotation.py)\n  - [Z Algorithm](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/strings/z_algorithm.py)\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n  \u003csummary\u003eMisc\u003c/summary\u003e\n\n  - [bootstrap for recursion](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/misc/bootstrap.py)\n  - [FastIO](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/misc/FastIO.py)\n  - [heapq](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/data_structures/Heap.py)\n  - [sorted](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/misc/ordersort.py)\n  - [py3k compatibility tools](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/misc/py3k.py)\n  - [random](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/misc/Random.py)\n  - [str.split for whitespace](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/misc/split.py)\n  - [Bit Hacks](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/misc/bit_hacks.py)\n  - [32-bit Modular Arithmetic](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/misc/mod.py)\n  - [Memoize Decorators](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/misc/memoize.py)\n  - [C++ syle cout](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/misc/ostream.py)\n  - [Interactive Runner](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/tools/interactive_runner.py)\n  - [Stress Tester](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/tools/stress_tester.py)\n  - [Alpha–Beta Pruning](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/misc/alphabeta.py)\n  - [Longest Increasing Subsequence](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/misc/lis.py)\n  - [K-th Order Statistic](https://github.com/cheran-senthil/PyRival/blob/master/pyrival/misc/order_statistic.py)\n\u003c/details\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheran-senthil%2Fpyrival","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheran-senthil%2Fpyrival","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheran-senthil%2Fpyrival/lists"}