在线法官服务工具

online-judge-tools的Python项目详细描述


在线评判工具

TravisAppVeyorDocumentation StatusPyPIPyPIPyPIPyPIDownloadsJoin the chat at https://gitter.im/online-judge-tools/community

在线法官服务工具。下载示例案例、测试/提交代码和各种实用程序。

屏幕广播

screencast

功能

  • 下载示例案例
    • 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)。
  • 有管理模板或代码段的功能吗?
  • 我通常为每个比赛制作一个目录。有人支持这种风格吗?
    • 是的。您可以使用--directory-d)选项。但是,我建议为每个问题创建一个目录。
  • 我可以用他们的id或名字而不是url来指定问题吗?
    • 没有,我试过一次,但实际上不太方便,只会增加维修费用。
  • 我不想把我的密码给这个程序。
    • 您可以使用它只提供您的会话令牌。请看here

对于其他问题,请使用Gitter或其他sns。

相关工具

冲突:

不冲突:

取决于KMYK/在线评判工具的项目:

  1. 包装纸:
  2. 用于CI的库:
  3. 其他:

作者

此外,还使用从 @kjnh10@hachi-88@Pachicobue@kfaRabi, 以及@tMasaaa

许可证

麻省理工学院许可证

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java未从Facebook OAuth接收名字、姓氏和姓氏   我自己代码中的java ConcurrentModificationException   java在Android上获得单像素TIFF图像   java图形输出中的swing集成弹出窗口“通知”   将数据库表中的所有数据集插入jTable Java   java如何使用Hibernate获取不完整的集合?   打印无法从java连接到打印机   java使用分隔符拆分带引号的字符串   java Axis2禁用严格验证(wsdl2java中的Eosv)允许什么,如何使其更加严格?   java有人能帮我处理循环代码吗   java将JsonObject数组转换为整数   JavaXWiki扩展:检测事件空间创建   java如何设置图表的文本方向以使用poi旋转所有文本?   eche RecyclerView项的java Set自定义字体   java单元测试带有私有构造函数的spring组件,无需注入   用户界面如何在java中动态显示一组多个元素?   如何从java应用程序调用IDL(交互式数据语言)?   Java的内置库实现