现在的位置: 首页 > 综合 > 正文

Topcoder Arena插件配置和训练指南

2019年03月13日 ⁄ 综合 ⁄ 共 1845字 ⁄ 字号 评论关闭

一、 Arena插件配置

1. 下载Arena

     指针:http://community.topcoder.com/tc?module=MyHome

     左边Competitions->Algorithms->Single Match Rounds->Launch Arena->Load Competition Arena

2. 下载插件

     指针:http://community.topcoder.com/tc?module=Static&d1=applet&d2=plugins

     下载三个插件:FileEdit,CodeProcessor1.2,TZTester

      将1中下载的Arena和2中下载的三个插件放在同一个目录下。

3. 插件配置

  •  启动Arena并登陆

         要运行Arena,需要有JRE(Java Runtime Environment)
  •  

    1. 在option中选择Editor
    2. 点ADD
    3. name可以随便取一个,如CodeProcessor
    4. EntryPoint填:codeprocessor.EntryPoint,注意区分大小写
    5. classpath一栏,反复使用Browse加入CodeProcessor.jar,FileEdit.jar,TZTester.jar等,也可以手动输入,多个类之间以”;”隔开,可以使用相对路径。
    6. 如果设置正确,在点ok后,列表中就会多出一项
    7. 选择CodeProcessor,点Configure
      1. 在Editor EntryPoint里输入fileedit.EntryPoint,Configure可以对Editor进行详细的配置
      2. 在Processor Class里输入tangentz.TZTester,Verify可以校验输入是否正确
      3. 配置fileedit,点Configure, 弹出一个配置对话框. 在General选项卡中, 可以指定要保存的文件的位置.
        选中Write       Problem Description to separate file, 把File Extension改为html. 然后转到Code Template选项卡, 输入代码模板, 如下:
        $BEGINCUT$
        $PROBLEMDESC$
        $ENDCUT$
        #line $NEXTLINENUMBER$ "$FILENAME$"
        #include <vector>
        #include <list>
        #include <map>
        #include <set>
        #include <deque>
        #include <stack>
        #include <bitset>
        #include <algorithm>
        #include <functional>
        #include <numeric>
        #include <utility>
        #include <sstream>
        #include <iostream>
        #include <iomanip>
        #include <cstdio>
        #include <cmath>
        #include <cstdlib>
        #include <ctime>
        #include <cstring>
        using namespace std;
        class $CLASSNAME$
        {
        public:
        $RC$ $METHODNAME$($METHODPARMS$)
        {
        //$CARETPOSITION$
        }
        $TESTCODE$
        };
        
        // BEGIN CUT HERE
        int main()
        {
        $CLASSNAME$ ___test;
        ___test.run_test(-1);
        system("pause");
        }
        // END CUT HERE

  • 可以在competition arena里Options->Setup User Interface->Editors设置一下自己的默认编程语言.

    接下来去Practice Room打开一道题, Code Processor会自动帮你把题目写成html文件, 并帮你创建一个cpp的模板, TZTester还会为你插入样例测试的代码. 这样就可以直接在自己的编辑器中写代码, 然后在本地运行一下就能看到是不是通过样例了, 不需要在tc的编辑器中慢慢选样例了. 提交的时候插件会自动帮你删除不必要的代码. 

    在本地测试没问题后,分别点击Save->Compile->Submit即可,提交后可以在Practice Options里选择Run System Test就可以看自己程序的正确性了。

    p.s. topcoder对程序的时间限制是2 seconds, 10^9次基本运算大概是1 second.

    可以先试试做几道题训练一下,再训练参赛。

抱歉!评论已关闭.