在线法官服务工具
online-judge-tools的Python项目详细描述
在线评判工具
在线法官服务工具。下载示例案例、测试/提交代码和各种实用程序。
屏幕广播
功能
- 下载示例案例
- atcoder
- Yukicoder
- 无政府高尔夫
- 共作用力
- 哈克朗
- 民族在线评委(含竞技场)
- CS学院
- 北大审判线
- 卡蒂斯
- toph(问题存档)
- Facebook黑客杯
- 下载系统测试用例
- Yukicoder
- 爱祖在线评委
- 登录
- atcoder
- Yukicoder(通过github.com或session token)
- 共作用力
- 哈克朗
- 顶部编码器
- 顶部
- 提交解决方案
- atcoder
- Yukicoder
- 共作用力
- 哈克朗
- Topcoder(马拉松比赛)
- toph(问题存档)
为输入生成扫描仪(已删除,使用kyuridenamida/atcoder-tools)- atcoder
- Yukicoder
- 测试您的解决方案
- 测试您的解决方案是否存在反应性问题
- 从输入和引用实现生成输出文件
- 将包含多个案例的输入文件拆分为文件
如何安装
使用编译的二进制文件
windows的可移植可执行文件oj.exe
可从GitHub releases下载。
来自Pypi
包裹是https://pypi.python.org/pypi/online-judge-tools。
$ pip3 install online-judge-tools
它需要Python3.5或更高版本。
从这个存储库
$ git clone https://github.com/kmyk/online-judge-tools
$ cd online-judge-tools
$ pip3 install -e .
如何使用
$ oj [download,login] URL $ oj submit URL FILE [-l LANGUAGE] $ oj test[-c COMMAND][TEST...]
有关详细信息,请参见--help
。
示例
$ oj download http://agc001.contest.atcoder.jp/tasks/agc001_a [+] problem recognized: <onlinejudge.atcoder.AtCoder object at 0x7f2925a5df60> [x] GET: http://agc001.contest.atcoder.jp/tasks/agc001_a [+]200 OK [*] sample 0[x] input: 入力例 121312[+] saved to: test/sample-1.in [x] output: 出力例 13[+] saved to: test/sample-1.out [*] sample 1[x] input: 入力例 25100123141558585829[+] saved to: test/sample-2.in [x] output: 出力例 2135[+] saved to: test/sample-2.out [*] sample 2[x] input: Sample Input 121312[+] saved to: test/sample-3.in [x] output: Sample Output 13[+] saved to: test/sample-3.out [*] sample 3[x] input: Sample Input 25100123141558585829[+] saved to: test/sample-4.in [x] output: Sample Output 2135[+] saved to: test/sample-4.out
如何用作库
阅读文档:https://online-judge-tools.readthedocs.io/en/master/
用作库的示例
下面的代码列出了最短的提交问题的atcoder初学者竞赛xxx。
#!/usr/bin/env python3fromonlinejudge.service.atcoderimport*forcontestinAtCoderService().iterate_contests():ifnotcontest.contest_id.startswith('abc'):forproblemincontest.list_problems():submission=next(problem.iterate_submissions_where(status='AC',order='source_length'))problem_full_name='{}: {} - {}'.format(contest.get_name(),problem.get_alphabet(),problem.get_name())shortest_info='({} byte, {})'.format(submission.get_code_size(),submission.get_language_name())print(problem_full_name.ljust(60),submission.get_user_id().ljust(12),shortest_info)
示例输出:
AtCoder Beginner Contest 121: A - White Cells kotatsugame (26 byte, Perl6 (rakudo-star 2016.01))
AtCoder Beginner Contest 121: B - Can you solve this? kotatsugame (49 byte, Octave (4.0.2))
AtCoder Beginner Contest 121: C - Energy Drink Collector x20 (54 byte, Perl (v5.18.2))
AtCoder Beginner Contest 121: D - XOR World climpet (40 byte, Perl (v5.18.2))
AtCoder Beginner Contest 120: A - Favorite Sound kotatsugame (25 byte, Awk (mawk 1.3.3))
AtCoder Beginner Contest 120: B - K-th Common Divisor n4o847 (35 byte, Awk (mawk 1.3.3))
AtCoder Beginner Contest 120: C - Unification kotatsugame (32 byte, Octave (4.0.2))
AtCoder Beginner Contest 120: D - Decayed Bridges x20 (154 byte, Perl (v5.18.2))
AtCoder Beginner Contest 119: A - Still TBD morio__ (22 byte, Sed (GNU sed 4.2.2))
AtCoder Beginner Contest 119: B - Digital Gifts n4o847 (31 byte, Perl (v5.18.2))
AtCoder Beginner Contest 119: C - Synthetic Kadomatsu kotatsugame (135 byte, Perl (v5.18.2))
AtCoder Beginner Contest 119: D - Lazy Faith kotatsugame (179 byte, Octave (4.0.2))
AtCoder Beginner Contest 118: A - B +/- A n4o847 (19 byte, Awk (mawk 1.3.3))
AtCoder Beginner Contest 118: B - Foods Loved by Everyone kotatsugame (37 byte, Perl6 (rakudo-star 2016.01))
...
常见问题解答
- 我不能安装这个工具。我该怎么办?
- 检查python的版本。如果使用windows环境,还可以考虑使用windows subsystem for linux(wsl)。
- 有管理模板或代码段的功能吗?
- 不,他们不是这个工具的责任。您应该使用编辑器的插件,比如thinca/vim-template或Shougo/deoplete.nvim。
- 我通常为每个比赛制作一个目录。有人支持这种风格吗?
- 是的。您可以使用
--directory
(-d
)选项。但是,我建议为每个问题创建一个目录。
- 是的。您可以使用
- 我可以用他们的id或名字而不是url来指定问题吗?
- 没有,我试过一次,但实际上不太方便,只会增加维修费用。
- 我不想把我的密码给这个程序。
- 您可以使用它只提供您的会话令牌。请看here。
对于其他问题,请使用Gitter或其他sns。
相关工具
冲突:
- dj3500/hightail(基于gui;我从未使用过)
- nodchip/OnlineJudgeHelper(不建议有车)
- kyuridenamida/atcoder-tools(测试良好,但仅限于atcoder)
不冲突:
- shivawu/topcoder-greed用于Topcoder单轮匹配
- FakePsyho/mmstats用于Topcoder马拉松比赛
- https://community.topcoder.com/tc?module=Static&d1=applet&d2=plugins
取决于KMYK/在线评判工具的项目:
- 包装纸:
- kjnh10/pcm
- Tatamo/atcoder-cli
- 我的一个朋友通过vscode的快捷键使用
oj
- 用于CI的库:
- blue-jam/ProconLibrary使用
oj
表示ci - kmyk/competitive-programming-library使用
oj
表示ci
- blue-jam/ProconLibrary使用
- 其他:
- fukatani/rujaion是一个用于带有rust的竞争性编程的ide
- kmyk/AtCoderProblemsStatic是kenkoooo/AtCoderProblems的克隆
- kmyk/atcoder-auto-debugger是一个程序,用于分析atcoder提交的内容并查找错误
作者
- 所有者:@kmyk(atcoder:kimiyuki,codeforces:kimiyuki)
- 合作者:@fukatani(atcoder:ryoryoryo111)
此外,还使用从 @kjnh10, @hachi-88, @Pachicobue, @kfaRabi, 以及@tMasaaa。
许可证
麻省理工学院许可证