|
1 | 1 | <p align="center"> |
2 | 2 | <img width="100px" src="https://github.com/likespro.png" align="center" alt="Competitive Template" /> |
3 | | - <h2 align="center">likespro - Competitve Template</h2> |
4 | | - <p align="center">Template for programming competitions used by likespro. Written in C++.</p> |
| 3 | + <h2 align="center">Competitive Programming Template by likespro</h2> |
| 4 | + <p align="center">Template for CP competitions used by likespro. Written in C++.</p> |
5 | 5 | </p> |
6 | 6 | <p align="center"> |
7 | | - <a href="https://github.com/anuraghazra/github-readme-stats/actions"> |
8 | | - <img alt="Build Passing" src="https://github.com/likespro/competitive-template/workflows/C/C++ CI/badge.svg" /> |
| 7 | + <a href="https://github.com/likespro/cp-programming-template/workflows/C/C++ CI"> |
| 8 | + <img alt="Build Passing" src="https://github.com/likespro/cp-programming-template/workflows/C/C++ CI/badge.svg" /> |
9 | 9 | </a> |
10 | | - <a href="https://github.com/anuraghazra/github-readme-stats/graphs/contributors"> |
11 | | - <img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/likespro/competitive-template" /> |
| 10 | + <a href="https://github.com/likespro/cp-programming-template/graphs/contributors"> |
| 11 | + <img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/likespro/cp-programming-template" /> |
12 | 12 | </a> |
13 | | - <a href="https://github.com/anuraghazra/github-readme-stats/issues"> |
14 | | - <img alt="Issues" src="https://img.shields.io/github/issues/likespro/competitive-template?color=0088ff" /> |
| 13 | + <a href="https://github.com/likespro/cp-programming-template/issues"> |
| 14 | + <img alt="Issues" src="https://img.shields.io/github/issues/likespro/cp-programming-template?color=0088ff" /> |
15 | 15 | </a> |
16 | | - <a href="https://github.com/anuraghazra/github-readme-stats/pulls"> |
17 | | - <img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/likespro/competitive-template?color=0088ff" /> |
| 16 | + <a href="https://github.com/likespro/cp-programming-template/pulls"> |
| 17 | + <img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/likespro/cp-programming-template?color=0088ff" /> |
18 | 18 | </a> |
19 | 19 | </p> |
20 | 20 | <p align="center"> |
21 | | - <a href="https://sonarcloud.io/summary/new_code?id=likespro_competitive-template"> |
22 | | - <img alt="Code Lines" src="https://sonarcloud.io/api/project_badges/measure?project=likespro_competitive-template&metric=ncloc" /> |
| 21 | + <a href="https://sonarcloud.io/summary/new_code?id=likespro_cp-programming-template"> |
| 22 | + <img alt="Code Lines" src="https://sonarcloud.io/api/project_badges/measure?project=likespro_cp-programming-template&metric=ncloc" /> |
23 | 23 | </a> |
24 | | - <a href="https://sonarcloud.io/summary/new_code?id=likespro_competitive-template"> |
25 | | - <img alt="Quality Rate" src="https://sonarcloud.io/api/project_badges/measure?project=likespro_competitive-template&metric=alert_status" /> |
| 24 | + <a href="https://sonarcloud.io/summary/new_code?id=likespro_cp-programming-template"> |
| 25 | + <img alt="Quality Rate" src="https://sonarcloud.io/api/project_badges/measure?project=likespro_cp-programming-template&metric=alert_status" /> |
26 | 26 | </a> |
27 | | - <a href="https://sonarcloud.io/summary/new_code?id=likespro_competitive-template"> |
28 | | - <img alt="Bugs" src="https://sonarcloud.io/api/project_badges/measure?project=likespro_competitive-template&metric=bugs" /> |
| 27 | + <a href="https://sonarcloud.io/summary/new_code?id=likespro_cp-programming-template"> |
| 28 | + <img alt="Bugs" src="https://sonarcloud.io/api/project_badges/measure?project=likespro_cp-programming-template&metric=bugs" /> |
29 | 29 | </a> |
30 | | - <a href="https://sonarcloud.io/summary/new_code?id=likespro_competitive-template"> |
31 | | - <img alt="Technical Debt" src="https://sonarcloud.io/api/project_badges/measure?project=likespro_competitive-template&metric=sqale_index" /> |
| 30 | + <a href="https://sonarcloud.io/summary/new_code?id=likespro_cp-programming-template"> |
| 31 | + <img alt="Technical Debt" src="https://sonarcloud.io/api/project_badges/measure?project=likespro_cp-programming-template&metric=sqale_index" /> |
32 | 32 | </a> |
33 | | - <a href="https://sonarcloud.io/summary/new_code?id=likespro_competitive-template"> |
34 | | - <img alt="Maintability" src="https://sonarcloud.io/api/project_badges/measure?project=likespro_competitive-template&metric=sqale_rating" /> |
| 33 | + <a href="https://sonarcloud.io/summary/new_code?id=likespro_cp-programming-template"> |
| 34 | + <img alt="Maintability" src="https://sonarcloud.io/api/project_badges/measure?project=likespro_cp-programming-template&metric=sqale_rating" /> |
35 | 35 | </a> |
36 | 36 | </p> |
37 | 37 |
|
|
40 | 40 |
|
41 | 41 |
|
42 | 42 | ## Overview |
43 | | -A C++ template that likespro uses for competitions such as CodeForces, ICPC, etc. |
| 43 | +A C++ template that likespro uses for competitions such as ICPC, CodeForces, AtCoder, etc. |
44 | 44 |
|
45 | 45 | The main goal of this template is to be very powerful and convenient. |
46 | 46 |
|
47 | | -The IDE where competitive-template is developing - Microsoft Visual Studio 2022 Community Edition. |
| 47 | +The IDE where cp-programming-template is developing - Microsoft Visual Studio 2022 Community Edition. |
48 | 48 |
|
49 | | -## How to use it |
| 49 | +### How to use it |
50 | 50 | Just copy & paste content of "likespro.eth - UNIVERSAL/likespro.eth - UNIVERSAL.cpp" to your empty program. Or simply download repo and start coding in this project. |
51 | 51 |
|
52 | | -## Why project name in VS is "likespro.eth - UNIVERSAL" |
| 52 | +## Template content |
| 53 | +### Includes |
| 54 | +* `iostream` |
| 55 | +* `vector` |
| 56 | +* `algorithm` |
| 57 | +* `cmath` |
| 58 | +* `set` |
| 59 | +* `map` |
| 60 | +* `numeric` |
| 61 | +* `queue` |
| 62 | +* `cassert` |
| 63 | +* `string` |
| 64 | +* `sstream` |
| 65 | +* `bitset` |
| 66 | +* `numeric` |
| 67 | +* `iomanip` |
| 68 | +* `unordered_map` |
| 69 | +* `random` |
| 70 | +### Namespaces |
| 71 | +* `std` |
| 72 | +### Common Definitions |
| 73 | +* `int` = `long long` |
| 74 | +* `uint` = `unsigned int` |
| 75 | +* `sz` = `size()` |
| 76 | +* `pb` = `push_back` |
| 77 | +* `mp` = `make_pair` |
| 78 | +* `all(n)` = `(n).begin(), (n).end()` |
| 79 | +* `rall(n)` = `(n).rbegin(), (n).rend()` |
| 80 | +* `elif` = `else if` |
| 81 | +* `flag` = `bool f = 0;` |
| 82 | +* `SVap` = `swap` (the most Essential Define from YuriyKap) |
| 83 | + |
| 84 | + |
| 85 | +* `forin` = `for(int i = 0; i < n; i++)` |
| 86 | +* `rofin` = `for(int i = n; i >= 0; i--)` |
| 87 | +* `fori(n)` = `for(int i = 0; i < (n); i++)` |
| 88 | +* `rofi(n)` = `for(int i = (n); i >= 0; i--)` |
| 89 | +### Definitions for Wrong Spelling |
| 90 | +* `iont` = `int` |
| 91 | +* `itn` = `int` |
| 92 | +* `for9int` = `for(int` |
| 93 | +* `svap` = `SVap` |
| 94 | +* `breakl` = `break` |
| 95 | +* `continuel` = `continue` |
| 96 | +* `voif` = `void` |
| 97 | +### Definitions for Constants |
| 98 | +* `INF` = `2000000000` |
| 99 | +* `MOD` = `1000000007` |
| 100 | +* `MOD_EOLYMP` = `998244353` |
| 101 | +* `PI` = `3.14159265359` |
| 102 | +* `ALPHABET` = `abcdefghijklmnopqrstuvwxyz` |
| 103 | +* `YES` = `YES` |
| 104 | +* `NO` = `NO` |
| 105 | +* `BUF_SZ` = `1000000` |
| 106 | +* `INT_MAX` = `2147483647` |
| 107 | +* `INT_MIN` = `-2147483648` |
| 108 | +### New Types |
| 109 | +* `Trip` - Structure with three elements - `first`, `second` and `third` |
| 110 | +### Binded Types |
| 111 | +* `vi` = `vector<int>` |
| 112 | +* `vvi` = `vector<vi>` |
| 113 | +* `vb` = `vector<bool>` |
| 114 | +* `vvb` = `vector<vb>` |
| 115 | +* `pii` = `pair<int, int>` |
| 116 | +* `pdi` = `pair<double, int>` |
| 117 | +* `pipii` = `pair<int, pii>` |
| 118 | +* `tiii` = `Trip<int, int, int>` |
| 119 | +* `vpii` = `vector<pii>` |
| 120 | +* `vpdi` = `vector<pdi>` |
| 121 | +* `vpipii` = `vector<pipii>` |
| 122 | +* `vvpii` = `vector<vpii>` |
| 123 | +* `vtiii` = `vector<tiii>` |
| 124 | +* `vc` = `vector<char>` |
| 125 | +* `vvc` = `vector<vc>` |
| 126 | +* `vstr` = `vector<string>` |
| 127 | +* `si` = `set<int>` |
| 128 | +* `spii` = `set<pii>` |
| 129 | +* `vsi` = `vector<si>` |
| 130 | +* `msi` = `multiset<int>` |
| 131 | +* `mspii` = `multiset<pii>` |
| 132 | +* `mii` = `map<int, int>` |
| 133 | +* `mapsi` = `map<string, int>` |
| 134 | +* `mib` = `map<int, bool>` |
| 135 | +* `mipii` = `map<int, pii>` |
| 136 | +* `mitiii` = `map<int, tiii>` |
| 137 | +* `mpiivpii` = `map<pii, vpii>` |
| 138 | +* `misi` = `map<int, si>` |
| 139 | +* `mivi` = `map<int, vi>` |
| 140 | +* `qi` = `queue<int>` |
| 141 | +* `vqi` = `vector<qi>` |
| 142 | +### Misc Abbreviates |
| 143 | +* `via` = `vi a` |
| 144 | +* `vib` = `vi b` |
| 145 | +* `vian` = `vi a(n)` |
| 146 | +* `viam` = `vi a(m)` |
| 147 | +* `vibn` = `vi b(n)` |
| 148 | +* `vibm` = `vi b(m)` |
| 149 | +### Inline Functions (macros) |
| 150 | +* `retyes` - prints "YES" and returns from function where it was called |
| 151 | +* `retno` - prints "NO" and returns from function where it was called |
| 152 | +### Functions |
| 153 | +* `xin()` - reads new `long long` number from `stdin` using `cin` and returns this number |
| 154 | +* ~~`fileio(filename, [input_file_suffix], [output_file_suffix])` - binds `<filename><input_file_suffix>` to `stdin` and `<filename><input_file_suffix>` to `stdout`. Default value for `input_file_suffix` is `.in`, for `output_file_suffix` - `.out`.~~ Temporary disabled because `Microsoft Visual Studio 2022` does not support it |
| 155 | +* `tros(begin_iterator, end_iterator)` - sort array in order from the biggest to the lowest |
| 156 | +### Operators |
| 157 | +* `>>vector` - `istream` for `vector`, reads to all elements. Example of usage: `cin>>vector;` |
| 158 | +* `<<vector` - `ostream` for `vector`, prints all elements separated by space. Example of usage: `cout<<vector;` |
| 159 | +### New Namespaces |
| 160 | +* `CompilerTests` - simple functions to test if compiler is working properly. Contains: |
| 161 | + * `helloWorld()` - print `Hello, world!` |
| 162 | + * `sum()` - read 2 numbers and output their sum |
| 163 | +### Main Function |
| 164 | +* `srand(time(NULL))` - initializes default random using current time as seed |
| 165 | +* `ios::sync_with_stdio(false)` - disables sync with stdio for higher performance of `cin` and `cout` |
| 166 | +* `cin.tie(0); cout.tie(0)` - optimizations for `cin` and `cout` |
| 167 | +* `bool multiTestEnabled = false` - if set to `true`, the program will read number of subtests and run those times the specified function with solution for subtest |
| 168 | +* `while (t--) <function with solution>` - here you need to specify the function with solution |
| 169 | + |
| 170 | +## Q&A |
| 171 | +### Why project name in VS is "likespro.eth - UNIVERSAL" |
53 | 172 | This is because the file where likespro code all solutions is called so; template is extracted from the file with solutions. |
54 | 173 |
|
55 | | -## I want to view raw file with some tasks solutions |
| 174 | +### I want to view raw file with some tasks solutions |
56 | 175 | Raw file with no extracted solutions is in "tasks-solutions" branch. But I really wonder why do you need it... |
0 commit comments