TopCoderの環境構築メモ


このエントリーをはてなブックマークに追加

Windows 10にTopCoderのための環境を構築したときの簡易的なメモです。

Javaランタイムのインストール

Java Appletの入手

  • Googletopcoder java appletで検索して出てくるリンクからアプレットをダウンロード。現時点での直リンクはこちら

サイトリストの追加

http://topcoder.com
http://www.topcoder.com
http://arena.topcoder.com
https://topcoder.com
https://www.topcoder.com
https://arena.topcoder.com   
  • 追加後の画面の一例 f:id:minus9d:20190430092319p:plain

greedプラグインの導入

greedプラグインを入れることで、テンプレートを自動挿入したり、手元でのテストが簡単に行えたりが簡単になる。

私の場合は以下のように設定ファイルを書いている。

  • workspaceとして設定したディレクトリに greed.confという名前で以下のファイルを作成
greed.language.cpp.templateDef.source.templateFile = "my_template.cpp"
greed.language.python.templateDef.source.templateFile = "my_template.py"
  • ディレクトリにmy_template.cppという名前で以下のファイルを作成
#include <iostream>
#include <sstream>
#include <string>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <functional>
#include <numeric>
#include <iomanip>
#include <cstring>
#include <fstream>

using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;

#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i,a,b) for(int i = (a); i < (int)(b); ++i)
#define ALL(c) (c).begin(), (c).end()
#define SIZE(v) ((int)v.size())

#define pb push_back
#define mp make_pair
#define mt make_tuple

using namespace std;

class ${ClassName} {
    public:
    ${Method.ReturnType} ${Method.Name}(${Method.Params}) {
        return ${Method.ReturnType;zeroval};
    }
};

${CutBegin}
${<TestCode}
${CutEnd}
  • ディレクトリにmy_template.pyという名前で以下のファイルを作成
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import re
import string

class ${ClassName}:
    def ${Method.Name}(self, ${Method.Params}):
        return ${Method.ReturnType;zeroval}

${CutBegin}
${<TestCode}
${CutEnd}