Presets for NOI series Algorithm Contests
Presets for NOI series Algorithm Contests
System Settings
1 | gsettings set org.gnome.desktop.interface cursor-blink false |
Editor Configuration
GNOME Terminal
Change color schemes to Tango dark
.
Vim
in ~/.vimrc
1 | syntax on |
Code::Blocks IDE Configuration (Debugging)
Reminder: debugging with Code::Blocks requires
pasting original code to main.cpp
then paste the modified
version back, be careful!
Create a new project
choose Console application
specify folder name (must done)
copy code to
main.cpp
to start debugging;
Code Snippets/Templates
C++ main solution file
in ~/cpp.cpp
1 |
|
C++ generator
1 |
|
checker script (random test cases batching)
Reminder: compile solution code without local flag.
one-liner validator script
1 | for ((i=0; i < 10000; ++i)) { |
one-liner stress test script
1 | for ((i=0;i<10000;++i)) { |
other linux utilities
generate strings from
/dev/urandom
.
1 | tr -dc "[a-z]" < /dev/urandom | head -c 1000 |
Reminders
Checklist
- data type
- overflow
- typo/logic
- special cases
- cleanup (multi-test)
- bounds
- memory usage
- file IO
Coding (Vim)
Since it's auto compile, never blindly
:wq
out of vim. Instead, see the compiler logs.backup source file before massive modifications.
use vim with a calm mind to prevent disasters.
Update
1 |
|
1 | syntax on |