从头开始创建在线法官 [英] Creating an online judge from scratch

查看:37
本文介绍了从头开始创建在线法官的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我参加了一些在线编程比赛,发现在线评委的功能非常出色.

I've participated in a few online programming contests and found the online judges used quite remarkable in functionality.

说到正题,我所在的大学也即将举办一场在线编程大赛,我负责这个活动.我正在评估实施在线法官的选择.当然,我可以利用一些已有的评委,例如 SPOJ 的评委,但令我震惊的是,我和我的一些朋友也可以尝试建立一个评委.如果我们失败了,我们总是可以依靠这些.

Coming to the point of the topic, my college is also about to hold an online programming contest and I'm in charge of the event. I was evaluating my options for implementing an online judge. Sure I could make use of some already available judges like the one at SPOJ but it struck me that I and a few of my friends can as well try building one. If we fail, we can always fall back on these.

那么任何人都可以给我一些大纲或资源,让我了解如何解决它?如果我对评委如何实现沙盒化"有所了解,也会有所帮助.我们大约有几个月的时间.

So can anyone please give me some outline or resources as to how do I get about it? It'd be also helpful if I get some idea about how the judges achieve 'sandboxing'. We got about a couple of months in hand.

更新 这是我在 2 周内就 SO 本身提出更多问题后迄今为止我努力的结果 http://github.com/anomit/loki

UPDATE This is the outcome of my effort so far in 2 weeks after asking a couple of more questions on SO itself http://github.com/anomit/loki

推荐答案

我真的不知道你的问题是关于什么的.从头开始为法官编写设计规范并不难.

I'm really not sure what your question is about. It's not hard to write a design spec for a judge from scratch.

您使用给定的输入数据运行一个事物,并将输出数据提供给问题作者编写的测试程序(因为并不总是唯一的答案).人们通过在干净的机器上远程运行来进行沙箱.

You run a thing with given input data and feed the output data to the test program written by the question's author (because there's not always unique answer). People do sandboxing by running it remotely on a clean machine.

添加:请不要进行代码分析.您有两种选择,要么在比赛期间向参赛者提供此代码分析,要么不提供.

Add: and please, no code analysis. You have two choices, either you make this code analysis available to contestants during the contest, or not.

  • 如果你这样做了:他们会用最后 5 分钟的时间来确保没有失败点.代码在这个过程中变得更糟.

  • If you do: they spend last 5 minutes of their time to make sure there are no down points. The code grows much worse in the process.

如果你不这样做:你违反了法治":人们知道给分的机制(这也是为什么你总是在问题文本中给他们第一个测试).

If you don't: you break the "rule of law": that people know the mechanism for giving points (also, that's why you always give them the first test in the text of the problem).

更新:抱歉,我一开始没注意到你问了一些具体的问题.沙盒可能没有你想象的那么重要——在一场好的比赛中,代码会公开可用,所以黑客"会很尴尬.但是,我想我看到了一种实践,您不能直接与系统进行 i/o、文件系统或任何其他交互(他们为您编写 main() 并且它总是相同的;您只用给定的输入/输出流编写算法部分).您的法官应该只运行它自己从源代码编译的内容.

Update: Sorry, I didn't notice at first that you ask some specific questions. Sandboxing may be less important than you think -- in a good competition the code becomes publicly available, so the "hackers" would be really embarrassed. However, I think I saw a practice where you can't do the i/o, filesystem or any other interaction with the system directly (they write main() for you and it's always the same; you only write the algorithm part with given input/output streams). Your judge should run only what it itself compiled from the source.

这篇关于从头开始创建在线法官的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆