Egor's blog

By Egor, 8 years ago, translation, In English,

Good news everyone!

Today at 16:00 UTC a dozen people will get their places in Parallel Round 3B ;)

Good luck all!

Read more »

 
 
 
 
  • Vote: I like it
  • +78
  • Vote: I do not like it

By Egor, 8 years ago, translation, In English,

Good news everyone!

Next TopCoder SRM scheduled today at 15:10 UTC

Read more »

 
 
 
 
  • Vote: I like it
  • +62
  • Vote: I do not like it

By Egor, 8 years ago, translation, In English,

New version released because of some TopCoder parsing bugs lately (SRM 530 Div-2 Medium, SRM 531 Div-2 Easy and SRM 534 Div-1 Medium). Other features: UI: switch task to current editor and editor to current task automatically Fixed width font for tests

Download link Configuration format had not changed

UPD: CodeChef generation fixed

Read more »

 
 
 
 
  • Vote: I like it
  • +2
  • Vote: I do not like it

By Egor, 9 years ago, translation, In English,
1. Installation
You need to download plug-in and configuration. Plug-in should go to %home_dir%\.IntelliJIdea10\config\plugins (if directory plugins is absent you need to create it), also you should include chelper.jar to class path of your project (Project Structure -> Dependencies -> Add Single Entry Module Library...). After that you need to edit configuration (see next section) and put it in project root. That's it — you are all set. For TopCoder you would need moj plugin for Arena, manual and download link is here

2. Configuration
As a general note, if some property in configuration represents a folder you must enter relative path from project root (using / instead of )
inputClass - full qualified name of class used for input (like java.util.Scanner). This class should implement method next that returns String — next token from input — and it should have constructor that takes InputStream as only argument
outputClass - full qualified name of class used for output (like java.io.PrintWriter). Ouput class shoud has constructor, that take OuputStream and one that take Writer as parameter and also method close.
excludePackages - comma separated list of package prefixes. Classes from such packages would not be inlined but rather imported. In most cases you should leave it as is
outputDirectory - directory where full source code would be stored. Should be under source and in default package (for example, if you create standart idea project, "src" spould be ok)
author - content of @author tag in. If empty no author tag would be created
archiveDirectory - directory where tasks would be archived. Should not be under source
defaultDirectory - direcory where tasks would be created by default. Should be under source in non-default package (for example src/my/package)
topcoderDirectory - directory where moj puts its TopCoder stubs. Should be under source in default package (e.g. src)
enableUnitTests - should be true if you want unit tests to be created and false otherwise
testDirectory - directory where tests would be stored. Shoud be under source
After configuration change you need to reload project for changes to take effect

3. Actions
I would recommend to add following actions on main toolbar (Customize Menus and Toolbars... from context menu of toolbar, actions are in Plug-ins->CHelper): New Task, Edit Tests, Archive Task, Delete Task, Create Codeforces Tasks.



New Task (Alt+F2) — creates new task in defaultDirectory
Edit Tests (Alt+F5) — opens test editor

Archive Task (Alt+F6) — archives task (deletes all it files and stores them in archive, also creates unit tests if configured to do so)
Delete Task - deletes task and all associated files
Parse Contest - creates all tasks for particular contest (currently Codeforces, CodeChef, E-Olimp and Timus are supported).

Parse Task - creates single task.

Site Contest ID Problemset task ID Contest task ID
Codeforces contest_id (131) contest_id letter (131 A) contest_id letter (131 A)
CodeChef contest_code (NOV11) problem_code (GCD2) contest_code problem_code
(NOV11 DOMNOCUT)
Timus contest_id (101) problem_id (1000) contest_id problem_number (101 1)
Copy Source (Alt+F8) — copies content of Main.java to clipboard. This is useful for judges that do not support submission of file

4. New Task dialog

Name - task class name
Test type - type of tests — either single test per file, number of tests and then tests themselves or just some tests until some condition is met. You need to throw UnknownError in last case to indicate that there would be no more tests
Input type/Output type - input/output type. Standard — stdin/stdout, Task_id — file input/output with file names %Name%.toLowerCase() + ".in"/".out", Custom — just file input/output, names provided in separate text fields
Heap memory - memory limit
Stack memory - stack size limit (defaults are same as codeforces)

5. Task files
For each task 2 files is creates. In main task class there is one method:
void solve(int testNumber, %input% in, %output% out)
testNumber — 1-based index of test in file
In checker class there are 3 methods:
String check(%input% input, %input% expected, %input% actual)
should return null if answer is correct, non empty string if answer is wrong and empty string to run default checker
double getCertainty()
returns certainty for double comparision in default checker
Collection<? extends Test> generateTests()
additional generated tests

For TopCoder tasks the only class would contain method from problem statement. Task would be created automatically when you opens problem in TopCoder client (if moj properly configured)

Read more »

 
 
 
 
  • Vote: I like it
  • +29
  • Vote: I do not like it

By Egor, 9 years ago, translation, In English,
Updated to 2.33 - Codeforces page format changed
Updated to 2.32 - some debug output was not removed
Updated to 2.31 - TopCoder task sometimes do not run if first arguments is a String. Do not consitently reproducable

Changes:

Defect Task generation: CodeChef: Multiple samples not working
Defect TopCoder: main method not deleted even if unused
Enhancement Task Generation: E-Olimp support
Enhancement Task Generation: Timus support
Enhancement Tester: add option to trunkate long input/output and enable it by default
Enhancement Parser: remember selected contest/task site for current session

Input/output of more than 2000 characters are now truncated by default in tester - first 1500 and last 100 symbols are printed. You can turn this off in "Edit Configurations"
Formats of ids for new site would be added to manual
Download link, configuration format is intact

Read more »

 
 
 
 
  • Vote: I like it
  • +5
  • Vote: I do not like it

By Egor, 9 years ago, translation, In English,

Changes:

Enhancement Add universal interface for task generation
Enhancement Tester: ability to pass message from checker irrespective from verdict type
Defect New Task: default directory should be created if absent
Enhancement Create action to copy full source in order to submit to judges that do not provide file selection as option
Enhancement Task generation: support for CodeChef

Now you can generate single task from archive - enter "contest_number task_number" as id, for example - "128 B". Also CodeChef support is implemented. Problem statements on CodeChef are structured pretty badly, so heuristic algorithm is used to extract test cases, which may lead to extra spaces/new lines or complete fail (i.e. no task may be generated). For last 10 contests every task is generated. For Contest Parser please pass last part of contest url as id (e. g. NOV11), for tasks from archive - problem code (e.g. LCM), for tasks from contests - "contest_id problem_code" (e.g. "NOV11 DOMNOCUT")

Also "Copy Source" action added which just copies Main.java (generated source file) to clipboard. Useful for judges that do not support submitting files

Download link, configuration had not changed

Read more »

 
 
 
 
  • Vote: I like it
  • +9
  • Vote: I do not like it

By Egor, 9 years ago, translation, In English,

Changes:

Defect Codeforces generation: should unescape HTML
Defect TopCoderTester: should accept arrays without curle bracers
Enhancement Add ability to select tests on which task would be tested
Enhancement Allow using custom output class instead of PrintWriter
Enhancement Tester: Should return WA if actual is not exhausted in checker

New property added to configuration - outputClass. It is java.io.PrintWriter by default. Ouput class shoud has constructor, that take OuputStream and one that take Writer as parameter and also method close. You can leave your old configuration as all properties that are absent in configuration file are set to default values

Method next of input class shoud throw exception if file is exhausted (Scanner do this)

Download links: plugin, configuration

Read more »

 
 
 
 
  • Vote: I like it
  • +3
  • Vote: I do not like it

By Egor, 9 years ago, translation, In English,

Some screenshots:



Current version is 2.33

Let's try again. I had rewrote from scratch plug-in for IntelliJ Idea (that have free community edition, btw) which is designed to do the following:

1. Tests on all entered tests with one click

2. Inlines files from your library to your source code (inlucding removing of unused code)

3. Generates unit tests for your library based on entered tests.

First version seemed to be not very popular due to complexity of set up - special project, need of click "Run Task" each time before submit, etc.

In new version all this was fixed and, as a bonus, you can now create tasks for whole Codeforces contest (including sample tests already entered for you) by entering contest id.

Manual

That's all. Thank you for your time. Should you encounter any problem/bug using this plug-in please post comments to this entry insteam of sending me PM - that should help other people with same issues

Read more »

 
 
 
 
  • Vote: I like it
  • +38
  • Vote: I do not like it

By Egor, 9 years ago, translation, In English,

Google CodeJam World Final will be conducted on July 29th at 9:00 AM Tokyo time

Read more »

Tags gcj
 
 
 
 
  • Vote: I like it
  • +17
  • Vote: I do not like it

By Egor, 9 years ago, translation, In English,

Good afternoon.

TopCoder Open Online Round #4 will be conducted today at 12:00 ET. Top 60 participants will advance to the fifth round. Good luck!

Read more »

 
 
 
 
  • Vote: I like it
  • +54
  • Vote: I do not like it

By Egor, 9 years ago, translation, In English,

TopCoder SRM 511 will be conducted today at 17:00 GMT

Read more »

 
 
 
 
  • Vote: I like it
  • +41
  • Vote: I do not like it

By Egor, 9 years ago, translation, In English,

Good afternoon.

TopCoder Open Online Round #2 will be conducted today at 12:00 ET. Top 350 participants will advance to the third round. Good luck!

Read more »

 
 
 
 
  • Vote: I like it
  • +37
  • Vote: I do not like it

By Egor, 9 years ago, translation, In English,

Good afternoon.

TopCoder Open Online Round #1 will be conducted today at 12:00 ET. Top 850 participants will advance to the second round. Good luck!

Read more »

 
 
 
 
  • Vote: I like it
  • +49
  • Vote: I do not like it