What are some of the useful c++ commands or hacks helpful in competitive programming?
№ | Пользователь | Рейтинг |
---|---|---|
1 | jiangly | 3976 |
2 | tourist | 3815 |
3 | jqdai0815 | 3682 |
4 | ksun48 | 3614 |
5 | orzdevinwang | 3526 |
6 | ecnerwala | 3514 |
7 | Benq | 3482 |
8 | hos.lyric | 3382 |
9 | gamegame | 3374 |
10 | heuristica | 3357 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 168 |
2 | -is-this-fft- | 165 |
3 | atcoder_official | 161 |
3 | Um_nik | 161 |
5 | djm03178 | 157 |
6 | Dominater069 | 156 |
7 | adamant | 154 |
8 | luogu_official | 152 |
9 | awoo | 151 |
10 | TheScrasse | 147 |
What are some of the useful c++ commands or hacks helpful in competitive programming?
Название |
---|
You may refer to this quora question here:
Competitive Programming: What are some cool C++ tricks to use in a programming contest?
This CF blog post is probably also worth a read: Effective Usage of C++ STL for quick and concise code writing in competitive programming
#include <bits/stdc++.h>
is a beauty(basically, it includes everything you will ever need in a contest). Another "hack" that I like a lot is casting an integer to a bitset and then couting that bitset, it helps a lot in debugging bitmaasks ant the like. Other than that, practice, practice and more practice!Can u provide an example to illustrate the second part of your answer(casting an integer,debugging bitmasks)?Since i'm a beginner,i'm not able to understand that.
Like this. Debugging is just a use of it, sometimes you do a lot of bit-fiddling in an algo and you want to track down an error, but it may also help to cout the binary representation of a number if a problem asks for it, etc...
Include it, and add at least 1 second to your compiler time :(
http://codeforces.me/blog/entry/15643