您的位置:首页 > 运维架构

TopCoder SRM 插件配置,图文版

2011-05-14 21:41 309 查看
 网上看了不少tc插件配置的文章,有的有些小错误,有的把几篇合在一起,不方便看。

这里写下一篇自己配置的过程。

1.下载插件

下载地址:

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

使用了网上推荐的经典的3个插件

CodeProcessor v2.0:可以在预处理,后处理等流程调用其他插件,相当于批处理

FileEdit:读取题目描述,自动生成类代码到一个源文件,方便用其他IDE调用

TZTester:自动生成题目给的sample的测试代码,很方便

 

2.配置插件

进入TC竞技场

选择Options->Editors

 


 

 

点击Add按钮,增加一个Editor

名字随便起

EntryPoint表示入口类,这里填入 codeprocessor.EntryPoint  大小写敏感

ClassPath表示需要用到的类的jar包地址,使用Browse按钮3次,加入3个插件的jar包,会自动加分号



OK之后把新增的这行Default这列给勾上,作为默认的Editor

点击新增的行,再点Configure按钮,配置插件

Enter EntryPoint那里填fileedit.EntryPoint,processor class填tangentz.TZTester

点中fileedit.EntryPoint,点右侧的Configure

几个选项根据自己需要勾选,Code Temple里,选C++,填入模板



$BEGINCUT$
/*
$PROBLEMDESC$
*/
$ENDCUT$
#line $NEXTLINENUMBER$ "$FILENAME$"
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
using namespace std;

#define PB push_back
#define MP make_pair

#define REP(i,n) for(i=0;i<(n);++i)
#define FOR(i,l,h) for(i=(l);i<=(h);++i)
#define FORD(i,h,l) for(i=(h);i>=(l);--i)

typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<double> VD;
typedef long long LL;
typedef pair<int,int> PII;

class $CLASSNAME$
{
public:
$RC$ $METHODNAME$($METHODPARMS$)
{
$CARETPOSITION$
}
$TESTCODE$
};

// BEGIN CUT HERE
int main()
{
$CLASSNAME$ ___test;
___test.run_test(-1);
return 0;
}
// END CUT HERE


按几次Save回到竞技场,配置完成。

3.使用

打开题目后,在fileedit里设定的路径中自动创建了源文件,使用喜欢的IDE打开,在$CARETPOSITION$的地方写入你的代码。

写完后回到竞技场,点击compile编译,按submit提交,都是自动找之前建立的源文件,非常方便。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  plugins jar ide class 测试 c