# Installation
The library `lxml` is needed. Please reference
[here](http://lxml.de/installation.html) for more information.
If you are an Debian/Ubuntu user, simply type:
$ sudo apt-get install python-lxml
# Usage
Using [Codeforces Problem 198A problem
](http://codeforces.com/problemset/problem/198/A) as an example.
## Donwload Sample Tests
The url of this problem is
<http://codeforces.com/problemset/problem/198/A>. Please notice the
**contest_id** is **198** and the **problem_id** is **A**.
$ cf.py -c 198 -p A # download this problem
$ cf.py -c 198 # download all problems in this contest
There is another url <http://codeforces.com/contest/198/problem/A> which
indicated the same problem. You can see the contest_id and problem_id
is same, so it wouldn't be a problem.
## Running the Tests
Suppose your source code is named `A.{lang}`, which `{lang}` could be
`cpp`, `c`, `java` or `py` for the current version.
Then, simple run `cf.py A.{lang}`, you will get the result like this:
$ cf.py A.java
output:
2
=== Case #1: AC (85 ms) ===
output:
2
answer:
3
=== Case #2: WA (83 ms) ===
press enter to continue or <C-c> to leave.
output:
Exception in thread "main" java.lang.Exception
at A.<init>(A.java:12)
at A.main(A.java:18)
answer:
0
=== Case #3: RE (95 ms) ===
press enter to continue or <C-c> to leave.
## Configurations
The file `conf.py' contains the compile & execute commands of support
languages, so you could add more commands to support more languages
easily by yourself.
The section [global] in `conf.py` contains some setting about the *test
file*'s name. Since the *source code*'s name and the *test file*'s name
must be exactly same, you could change these settings to follow your
naming convension. For example:
In the default setting:
PATTERN = "upper({id})"
REPLACE_SPACE = "_"
EXTENSION = ".xml"
the filename would be 'A.xml'
Or you could added the *contest id* and *problem's name*: (also notice the
`replace_space`)
PATTERN = "{contest}-upper({id})-lower({name})"
REPLACE_SPACE = "-"
EXTENSION = ".xml"
the filename would be 'A-about-bacteria.xml'
# About
This tool is only verifiid on Linux now, but I think it could be run on
other platforms, although it maybe need a little modify.
Please feel free to fork and any suggesions are welcome.
没有合适的资源?快使用搜索试试~ 我知道了~
CodeforcesRunner:一个简单的工具,它运行Codeforces'测试用例更容易
共4个文件
md:1个
py:1个
example:1个
需积分: 20 2 下载量 68 浏览量
2021-06-01
06:27:29
上传
评论
收藏 5KB ZIP 举报
温馨提示
安装 图书馆lxml是必要的。 请参考了解更多信息。 如果你是一个于Debian / Ubuntu的用户,只需键入: $ sudo apt-get install python-lxml 用法 使用,例如, Donwload抽样检验 这个问题的URL 。 请注意contest_id是198和PROBLEM_ID是A。 $ cf.py -c 198 -p A # download this problem $ cf.py -c 198 # download all problems in this contest 还有另外一个网址这表明了同样的问题。 你可以看到contest_id和PROBLEM_ID是相同的,所以它不会是一个问题。 运行测试 假设你的源代码被命名为A.{lang} ,其中{lang}可能是cpp , c , java或py当前版本。
资源详情
资源评论
资源推荐
收起资源包目录
CodeforcesRunner-master.zip (4个子文件)
CodeforcesRunner-master
cf.py 6KB
conf.py.example 1KB
.gitignore 15B
README.md 2KB
共 4 条
- 1
张岱珅
- 粉丝: 50
- 资源: 4689
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0