Egor's blog

By Egor, 8 years ago, In Russian,

Good news everyone!

9 мая (всех с праздником!) в 5 утра по Москве, наше любимое время, состоится очередной SRM

Read more »

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

By Egor, 8 years ago, In Russian,

Состоится сегодня в 15:00 по Москве

Имеется призовой фонд в $5000, так что поспешите с регистрацией, кап может быть достигнут досрочно

Read more »

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

By Egor, 8 years ago, In Russian,

Я правильно понимаю, что по мнению авторов ГП Азова слон не является шахматной фигурой?

UPD: Официально объявлено, что Гран-при внезачетный

Read more »

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

By Egor, 8 years ago, In Russian,

FYI — началась регистрация

Финал 27 июля в Нью-Йорке (изначально сообщали про Париж, в какой-момент изменили — непонятно)

Read more »

 
 
 
 
  • Vote: I like it
  • +98
  • 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, 8 years ago, In Russian,
Как вы, может быть, знаете, в этом году TCO объявлен очень рано и уже идет в некоторых треках (Design, Development, Studio, etc.)
Позавчера объявили правила алгоритма и они очень серьезно изменились. Теперь нас ждут:
3 * Online Round 1 (бывший квалификационный раунд, из каждого выходят 600 человек, участвовать можно во всех, но регистрация закаплена на 2000 человек в каждый раунд)
3 * Online Round 2 (к 1800 победителям первого раунда добавляется топ-200 по рейтингу, из каждого забега выходит по 50 человек, участвовать можно во всех)
2 * Online Round 3 (из каждого выходит по 12 человек на онсайт, участвовать можно во всех)
Кроме того, для тех, кто уже вышел из 2го/3го раунда будут добавлены дополнительные рейтинговые раунды параллельно с раундами 2BC/3B (в таком раунде для 3B, например, смогут участвовать всего 12 человек - весело)
Одним из спонсоров будет Google, однако Петя может расслабиться - с этого года сотрудники компаний спонсоров, не участвующие непосредственно в подготовке контеста допускаются к участию.
Thoughts? Я думаю, что за счет новой системы отбора этот онсайт должен быть гораздо сильнее предыдущих
Вот ссылка на сайт. Я уже зарегистрировался, но вот сейчас совершенно не могу найти, где это сделать - может, из-за того, что я залогинен, мне не показывают ссылку на регистрацию

Read more »

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

By Egor, 8 years ago, In Russian,
Вроде бы контест уже совсем закончился
Кто-нибудь умеет вторую решать? Я послал наивное решение, которое в худшем случае работает за 22n, но придумать для него контртест не смог.

Read more »

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

By Egor, 8 years ago, In Russian,

Господа, а объясните мне тупому, как так вышло, что человека, который выиграл в один год GCJ и TCO первым на звание участника года выдвинул я перед самым концом процедуры выдвижения? Давайте исправим несправедливость. Выдвижение вот даже продлили до 17:00

UPD: идет голосование

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By Egor, 8 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, 8 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, 8 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, 8 years ago, In Russian,
Всем привет!

Сегодня в 20:00 по Москве состоится очередной TopCoder SRM

Read more »

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

By Egor, 8 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, 8 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, 8 years ago, In Russian,
Для моего плагина (а точнее - для акции, которая генерирует таски для контеста Codeforces) требуется иконка Codeforces размера 16*16. Есть такая?

Read more »

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

By Egor, 8 years ago, In Russian,

Мои знакомые знают, что я считаю, что Google довольно раздолбайски относятся к организации CodeJam. Однако сегодня я оценил, что такое настоящее раздолбайство со стороны организаторов контеста. Сегодня все участники онсайта RCC получили письмо с просьбой проверить, устраивает ли их билеты на поезд/самолет. То, что письмо пришло с e-mail'ами всех участников в сс (вместо bcc) - это ладно, привыкли уже. Но к письму прилагался файл, в котором помимо транспорта были указаны паспортные данные, домашние адреса и телефоны всех участников. Так что имейте ввиду на будущее как компания mail.ru относится к персональным данным

P. S. Я прекрасно понимаю, что надо поддерживать mail.ru в их полезном начинании провести контест, и догадываюсь, что у них не хватает человек, чтобы послать каждому финалисту отдельное письмо. Тем не мнее я считаю, что то, что произошло необходимо предать огласке

Read more »

Tags rcc
 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By Egor, 8 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, 8 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, 8 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, 8 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, 8 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

By Egor, 8 years ago, In Russian,
Состоится сегодня в 19:00 по Москве

Read more »

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

By Egor, 9 years ago, In Russian,
...состоится 16 апреля в 20:00 МСК

Read more »

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

By Egor, 9 years ago, translation, In English,
Here is an early alpha version of Contest helper plug-in for Intelli Idea

What this plug-in does:
  • Inline classes from your library into single file
  • Eliminates unused code from it
  • Stores tests and then you can test your solution on all of them with one click

Known bugs:
  • Sometimes "Delete task" do not delete .task file. You can do taht manually
  • Do not removes unused methods that are cyclically called
  • Never removes method that implements interface/overriding super method if class is retained and super class is retained
  • Never removes main method no matter what signature it has
  • Do not supports static imports
Use it at your own risk
Plug-in is supplied with project that has structure needed for this plug-in. It also contains 3 sample tasks - 2 plain and 1 TopCoder style
How to use:
  1. Add plug-in buttons on main toolbar (Customize Menus and Toolbars -> Main Toolbar -> Add after... -> Plug-ins -> Contest helper)
  2. Press "New Task".
  3. New class will be created where you must implement solve interface. Arguments for this interface are test case index (1 based), InputReader and PrintWriter. You may extend capabilities of InputReader by editing corresponding class in utils module
  4. "Edit test" allows you to add and edit tests for current task
  5. When you want to run or debug code on your tests push "Run Task" button. After it finish it work you may run one of predifined configurations (Run - for running created file from module test and Debug - for debugging in module main/lib. Same with Tester runs/debugs on tests you enetered)
  6. You need to do "Run Task" every time you entered new test/before submitting to server (it is advised to do it after each change to avoid forgetting doing it before submitting)
  7. You need to submit file "Main.java" from module test to server
For TopCoder you need to have some plug-in that creares code locally (e. g. moj) and set target dirrectory for FileEditor to root of module topcoder. Remember to push "Run task: before compiling in arena
Your library classes must be in module library in non-default package.

Links for download:

Source code is here. It is pretty dirty

Any feedback appretiated

Update: installation - put plug-in file to dirrectory %user dir%\.IntelliJIdea10\config\plugins  and restart Idea

Update 2: Next version released. If you allready downloaded prohect you only need to copy files main/Tester.java, test/Tester.java и utils/main/net/egork/utils/checker/Checker.java
Changes:
Button Restore Task restroes choosen task from package unsorted
Task file is synchronised with disk before Run Task
You can add tests from code using generateTests method of checker
You can test only on subset of tests - pass their number as command line arguments

Update 3: Small uncritical fix released. You only need to update plug-in, no changes to project

Read more »

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

By Egor, 9 years ago, In Russian,
состоится 8 апреля в 5:00 МСК

Read more »

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