返回排行榜

kth-competitive-programming/kactl

C++

KTH Algorithm Competition Template Library (... eller KTHs AC-tillverkande lapp)

algorithmcontestcppdata-structurescompetitive-programmingnotebookcc0
Star 增长趋势
Star
3.4k
Forks
958
周增长
Issues
52
1k2k3k
2017年6月2020年6月2023年7月2026年7月
README

KACTL

This repo hosts KACTL, KTH's ICPC team reference document. It consists of 25 pages of copy-pasteable C++ code, for use in ICPC-style programming competitions.

See kactl.pdf for the final, browsable version, and content/ for raw source code.

Aspirations

KACTL algorithms should be: useful, short, fast enough, well tested, and if relevant, readable and easy to modify. They should not be overly generic, since code is manually typed and that just adds overhead. Due to space issues, we also exclude algorithms that are very common/simple (e.g., Dijkstra), or very uncommon (general weighted matching).

If you feel that something is missing, could be cleaned up, or notice a bug, please file an issue or send a pull request!

Customizing KACTL

While KACTL is usable as is, it's also easy to modify if you want to create a personalized copy. In particular, you may want to change the cover page, or make your own choice of algorithms to include -- due to space concerns, not all algorithms in the repo are included in the pdf. You may also want to enable colored syntax highlighting.

content/kactl.tex is the main file of KACTL, and can be edited to change team name, logo, syntax highlighting, etc. It imports chapter.tex files from each of the content/ subdirectories, which define the contents of each chapter. These include source code, text and math in the form of LaTeX. To add/remove code from a chapter, add/remove a corresponding \kactlimport line from the chapter.tex file. For nicer alignment you might want to insert \hardcolumnbreak, \columnbreak or \newpage commands, though this is usually only done before important contests, and not on the main branch. The algorithms that are not included in the pdf are left commented out in chapter.tex.

To build KACTL, type make kactl (or make fast) on a *nix machine -- this will update kactl.pdf. (Windows might work as well, but is not tested.) doc/README has a few more notes about this.

Tips:

  1. Check out what's excluded by default by running make showexcluded. The default configuration is chosen to be a reasonable balance for beginners and advanced teams.
  2. Take advantage of the hashing when typing in these algorithms. Each algorithm has a 6 character MD5 hash in the upper right. This hash can be generated by using hash.sh or the :Hash command from the .vimrc. The hashing ignores whitespace and comments.

Coding style

KACTL uses a relatively terse coding style, with a handful of macros/typedefs defined in the template that help shorten the code. Line width is 63 chars, with tabs for indentation (tab = 2 spaces in the pdf).

Each algorithm contains a header with the author of the code, the date it was added, a description of the algorithm, its testing status, and preferably also source, license and time complexity.

kactl.pdf is to be kept to 25 pages + cover page. Occasionally the generated kactl.pdf is committed to the repo for convenience, but not too often because it makes git operations slower.

Testing

KACTL aims for a high level of confidence in algorithm correctness. Testing is done both on online judges and (for newer algorithms) with stress tests that compare output to a more naive algorithm for a large amount of randomly generated cases. These tests live in the stress-tests directory, and are run with CI on every commit. The CI also verifies that all headers compile (except for an exclude list in docs/scripts/skip_headers) and that the latex compiles.

old-unit-tests contains a couple of broken unit tests, last touched about ten years ago.

License

As usual for competitive programming, the licensing situation is a bit unclear. Many source files are marked with license (we try to go with CC0), but many also aren't. Presumably good will is to be assumed from other authors, though, and in many cases permission should not be needed since the code is not distributed. To help trace things back, sources and authors are noted in source files.

Everything in stress-tests is implicitly CC0, except reference implementations taken from around the Internet.

相关仓库
jwasham/coding-interview-university

A complete computer science study plan to become a software engineer.

Creative Commons Attribution Share Alike 4.0 Internationalcomputer-scienceinterview
356.8k84.4k
TheAlgorithms/Python

All Algorithms implemented in Python

PythonPyPIMIT Licensepythonalgorithm
thealgorithms.github.io/Python/
223k50.9k
trekhleb/javascript-algorithms

📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings

JavaScriptnpmMIT Licensejavascriptalgorithms
196.3k31k
CyC2018/CS-Notes

:books: 技术面试必备基础知识、Leetcode、计算机操作系统、计算机网络、系统设计

algorithmleetcode
cyc2018.xyz
184.8k50.8k
yangshun/tech-interview-handbook

Curated coding interview preparation materials for busy software engineers

TypeScriptnpmMIT Licenseinterview-questionscoding-interviews
techinterviewhandbook.org
141.1k16.7k
krahets/hello-algo

《Hello 算法》:动画图解、一键运行的数据结构与算法教程。支持简中、繁中、English、日本語,提供 Python, Java, C++, C, C#, JS, Go, Swift, Rust, Ruby, Kotlin, TS, Dart 等代码实现

JavaMavenOtheralgorithmsdata-structures
hello-algo.com
128.7k15.3k
TheAlgorithms/Java

All Algorithms implemented in Java

JavaMavenMIT Licensejavaalgorithms
66k21.2k
kdn251/interviews

Everything you need to know to get the job.

JavaMavenMIT Licensejavainterview
youtube.com/channel/UCKvwPt6BifPP54yzH99ff1g
65.1k12.9k
youngyangyang04/leetcode-master

《代码随想录》LeetCode 刷题攻略:200道经典题目刷题顺序,共60w字的详细图解,视频难点剖析,50余张思维导图,支持C++,Java,Python,Go,JavaScript等多语言版本,从此算法学习不再迷茫!🔥🔥 来看看,你会发现相见恨晚!🚀

Shellleetcodeprogrammer
62k12.3k
azl397985856/leetcode

LeetCode Solutions: A Record of My Problem Solving Journey.( leetcode题解,记录自己的leetcode解题之路。)

JavaScriptnpmOtheralgorithmleetcode
leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/
55.8k9.4k
algorithm-visualizer/algorithm-visualizer

:fireworks:Interactive Online Platform that Visualizes Algorithms from Code

JavaScriptnpmMIT Licensealgorithmdata-structure
algorithm-visualizer.org
48.7k7.6k
huihut/interview

📚 C/C++ 技术面试基础知识总结,包括语言、程序库、数据结构、算法、系统、网络、链接装载库等知识及面试经验、招聘、内推等信息。This repository is a summary of the basic knowledge of recruiting job seekers and beginners in the direction of C/C++ technology, including language, program library, data structure, algorithm, system, network, link loading library, interview experience, recruitment, recommendation, etc.

C++Otherinterviewinterview-questions
interview.huihut.com
38.1k8.1k