cfparser
cfparser copied to clipboard
Codeforces Parser for Emacs (Discontinued, see https://github.com/gabrielsimoes/cfparser.vim for a more actively developed analogue)
cfparser
Emacs plugin for participating in http://codeforces.com programming competitions.
Installation
- Install
curl - Download cfparser
- Add to your
~/.emacsfile the following:
(add-to-list 'load-path "/path/to/cfparser/")
(require 'cf-mode)
- Put
cf-modeminor mode to hook you wish. For example:
(add-hook 'find-file-hook 'cf-mode) ; enable cf-mode for all open files
Optional setup
In ~/.emacs file you can change variables:
cf-cookies-file- file, in whichcurlwill store cookiescf-default-language- language to be used when it was not recognized by extensioncf-test-command- shell command to compile and run your solution on sample tests. For example:
(setq cf-test-command
(concat
"g++ sol.cc; "
"for i in `ls *.in | sed 's/.in//'`; do "
"echo test $i; "
"./a.out < $i.in | diff - $i.ans; "
"done;"))
In file cf-languages.el you can adjust extension-to-language mappings.
Usage
C-c c w- Who am IC-c c s- Submit currently open fileC-c c i- Log InC-c c o- Log OutC-c c d- Download sample tests to current folder (0.in, 0.ans, 1.in ...)C-c c t- Executecf-test-commandC-c c l- List most recent submissions
Submit and save functions "guess" the contest number, problem index and the programming language by the current file name in one of the following forms:
directory/505/A/myfile.cppdirectory/505/a.cdirectory/505a.cc
See also
- gabrielsimoes/cfparser.vim -- Similar plugin for Vim. It has more features than this one (e.g it can display a problem statement).