Package: online-judge-tools
online-judge-tools/oj日本語版のREADME.mdojis a command to help solving problems on various online judges. This command automates downloading sample cases, generating additional test cases, testing for your code, and submitting it.ScreencastFeaturesDownload sample casesDownload system test casesLoginSubmit your codeTest your codeTest your code for reactive problemsGenerate input files from generatorsGenerate output files from input and reference implementationFor the detailed documentation, readdocs/getting-started.md.Many online judges (Codeforces, AtCoder, HackerRank, etc.) are supported.
For the full list, seethe table of online-judge-tools/api-client.How to installThe package ishttps://pypi.python.org/pypi/online-judge-tools.$pip3installonline-judge-toolsFor detailed instructions, readdocs/INSTALL.md.How to use$ojdownload[--system]URL$ojloginURL$ojsubmit[URL]FILE$ojtest[-cCOMMAND][TEST...]$ojtest-reactive[-cCOMMAND]JUDGE_COMMAND$ojgenerate-inputGENERATOR_COMMAND$ojgenerate-output[-cCOMMAND][TEST...]For details, see$ oj --help.Example$ojdownloadhttp://agc001.contest.atcoder.jp/tasks/agc001_a[INFO] online-judge-tools 11.2.0 (+ online-judge-api-client 10.8.0)[INFO] load cookie from: /home/user/.local/share/online-judge-tools/cookie.jar[NETWORK] GET: https://atcoder.jp/contests/agc001/tasks/agc001_a[NETWORK] 200 OK[INFO] sample 0[INFO] input: sample-121 3 1 2[SUCCESS] saved to: test/sample-1.in[INFO] output: sample-13[SUCCESS] saved to: test/sample-1.out[INFO] sample 1[INFO] input: sample-25100 1 2 3 14 15 58 58 58 29[SUCCESS] saved to: test/sample-2.in[INFO] output: sample-2135[SUCCESS] saved to: test/sample-2.out$cat<<EOF>main.py#!/usr/bin/envpython3n = int(input())a = list(map(int, input().split()))ans = max(a)print(ans)EOF$ojt-c"python3 main.py"[INFO] online-judge-tools 11.2.0 (+ online-judge-api-client 10.8.0)[INFO] 2 cases found[INFO] sample-1[INFO] time: 0.043601 sec[SUCCESS] AC[INFO] sample-2[INFO] time: 0.043763 sec[FAILURE] WAinput:5100 1 2 3 14 15 58 58 58 29output:3expected:135[INFO] slowest: 0.043763 sec  (for sample-2)[INFO] max memory: 10.064000 MB  (for sample-2)[FAILURE] test failed: 1 AC / 2 casesFAQCan I use Python (or Rust, D, Java, F#, Haskell, etc.) instead of C++?Yes. Please use--command(-c) option if needed. For example, for Python, you can run$ oj t -c "python3 main.py".I usually make one directory per one contest (or, site). Can I keep using this style?Yes, you can use the--directory(-d) option or$ rm -rf test/. However, we don't recommend this style, because you should make additional test cases by yourself and run stress tests to maximize your rating.Can I download all sample cases of all problems at once?No, but you can useoj-preparecommand inkmyk/online-judge-template-generator.Can I automatically compile my source code before testing?Yes, use your shell. Run$ g++ main.cpp && oj t.Can I automatically submit code after it passes tests?Yes, use your shell. Run$ oj t && oj s main.cpp. By the way, you need to take care of problems whose sample cases are not so strong.Can I remove the delays and the[y/N]confirmation before submitting code?Yes, put--wait=0option and--yesoption tooj ssubcommand. Of course, we don't recommend this. They exist for failsafe. For example, please consider a situation where if you save 3 seconds, you will move up 3 places on the standings. In such a case, if you get a penalty of 5 minutes, then you will move down at least 300 places on the standings.Is my password stored?No, your password is not stored into any files. This program stores only your session tokens (but of course, it's still credentials). Please readonlinejudge/_implementation/command/login.py.Does the config file exist?No. You can use your.bashrc(or similar files) instead. It's a config file of your shell. Readman bashand write shell aliases or shell functions. For example, if you want to use Python code for tests by default, writealias oj-test-python='oj t -c "python3 main.py"'to.bashrcand use$ oj-test-python.For other questions, useGitteror other SNSs.ResourcesRelated Toolsconflicted:jmerle/competitive-companionkyuridenamida/atcoder-toolsxalanq/cf-toolnodchip/OnlineJudgeHelpernot conflicted:shivawu/topcoder-greedfor Topcoder Single Round Matchprojects collaborating with kmyk/online-judge-tools:kmyk/online-judge-template-generatoranalyzes problems and generates templates including auto-generated input/output partskmyk/online-judge-verify-helperautomates testing your library for competitive programming and generate documentsTatamo/atcoder-cliis a thin wrapper optimized for AtCoderkjnh10/pcmis a tool which internally uses online-judge-toolsfukatani/rujaionis an IDE for competitive-programming with RustMaintainerscurrent maintainers@kmyk(AtCoder:kimiyuki, Codeforces:kimiyuki) (original author)maintainers who are not working now@fukatani(AtCoder:ryoryoryo111)@kawacchu(AtCoder:kawacchu)LicenseMIT License