MikeMirzayanov's blog

By MikeMirzayanov, history, 8 years ago, translation, In English

The language of the round is Kotlin. Kotlin is a statically-typed programming language that runs on the Java Virtual Machine and also can be compiled to JavaScript source code. Its primary development is from a team of JetBrains programmers based in Saint Petersburg, Russia (the name comes from the Kotlin Island, near St. Petersburg).

Here is an example of the simplest program on Kotlin to print sum of two numbers:

fun main(args: Array<String>) {
    val (x, y) = readLine()!!.split(' ').map(String::toInt)
    println(x + y)
}

Here are some links to help you with Kotlin:

You can download standalone compiler (version 1.0.1) by the link http://s.codeforces.com/files/kotlin-compiler-1.0.1.zip Also you need JRE (virtual Java machine), you can find it by the link http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

The password from the archives with IDEA (IDE supporting Kotlin out of the box): c8bf9dd9b91ad9ff Links to IDEA are below or you can download it from the official website

Good luck!

====

UPD: You can predownload development pack (sorry, 300MB). In fact, you can take part without it — the Custom Invocation tab will be available during the contest. Also we will publish more compact tools 30 minutes before the start.

OS
Linux http://s.codeforces.com/files/683-linux.7z
Windows http://s.codeforces.com/files/683-windows.7z
Mac OS http://s.codeforces.com/files/683-macos.7z

All archives are encrypted. The password will be announced 30 minutes before the contest.

========

Surprise Language Round #8 will start on June 16, 16:00 (UTC). It will be unusual entertaining contest. Solutions on the only programming language will be allowed.

Thus, it is expected that during the round, participants can get acquainted with the language and solve a few simple problems. The language will be announced 30 minutes before the start of the round. At the same time (or earlier but encrypted archives) we will publish the archives with the tools to write programs in this language.

I am pleased to announce that the top 20 participants will receive an exclusive t-shirt, and another 10 random participants among those who solved at least three problems will receive an exclusive t-shirt too.

The rules of the contest are as follows:

  • The contest is unrated for everybody.
  • The round uses ACM ICPC rules: the standing is defined by the number of solved problems, ties are resolved based on penalty time. Initially the penalty is 0, and for each solved problem it is increased by submission time (since the start of the contest) + 20 minutes for each failed submission. The solution is considered to be correct if it passes all tests from a predefined test set; you know whether the solution is right immediately after sending it. There are no hacks.
  • The round will have 8-10 problems, sorted by estimated complexity, and you have 2 hours to solve it.
  • Solutions are accepted only in one language, which will be announced in 30 minutes before the contest.
  • Please reread this post at the beginning of the contest: we will announce the language and add instructions to install the compiler (the contest interface will provide an option to run your solutions online as well) and links to useful manuals. Other than that, learning the language is up to the competitor. You can use any resources to solve the problems (as long as you remember that this is an individual competition); you don't have to limit yourself to the manuals provided in the post.

Good luck!

Full text and comments »

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

By MikeMirzayanov, 8 years ago, translation, In English

Sometimes you can meet interactive problems on programming contests (including Codeforces).

In problems of this type, the input data given to your program may be not predetermined but is built specifically for your solution. Jury writes a special program — interactor, such that its output is tranferred to the input of your solution, and the output of your program is sent to interactor’s input. In the other words, your solution and the interactor exchange the data and my decide what to print based on the "history of communication".

When you write the solution for the interactive problem it is important to keep in mind that if you output some data it is possible that this data is first placed to some internal buffer and may be not directly transferred to the interactor. In order to avoid such situation you have to use special flush operation each time you output some data.

Full text and comments »

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

By MikeMirzayanov, 8 years ago, translation, In English

Today, June 2, 2016 year, there was a technical failure, which I will remember for a long time. Several factors led to a serious malfunction of the Polygon system.

The fact that in the middle of May Polygon was transferred to servers located in Mail.Ru data centers. To transfer with almost no downtime (Polygon has a lot of data, about a terabyte) lsyncd utility has been used, which quickly pushed the file changes from the old server to the new one.

Today there was a reboot of the old server, which forced the unplanned start of lsyncd daemon. As a result it did the synchronization of data from the old server to the new again. So, data stored in the file system have been rolled back to the transfer time (May 13). The most unlucky fast that, unlike the old server where the backups system was set up well and reliable, on the new server, I quickly managed to set up only replication using the same lsyncd, which does not help in the incident of files deletion (as it forces the removals on the replica). Obviously, RAID-1 disks didn't save the data.

As a result, all file changes in the Polygon system made in three-week period were lost. Some information (statements, etc) is stored in the database, so accessible.

This night I urgently implemented the special link "Scraps" to download the archive with the available data. If a problem has been used in the Codeforces infrastructure, the packages remain in its cache of the judging system, they are available in archive.

I feel lousy realizing that my lack of attention to detail has led to such consequences. I distinctly remember the black day of Codeforces — and as a result many things have been much revised (everywhere mirrored disk arrays, replicas and backups). Unfortunately, this time after moving to new hardware I did not return all scripts and here is the result. Problem writers please accept my deepest apologies for my mistake.

Full text and comments »

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

By MikeMirzayanov, history, 8 years ago, translation, In English

Hi!

I know that it will be obvious for real C++-masters, but for me it is small surprise. I used to think that signed overflow in C ++ does not cause real undefined behavior on a particular platform. That is, it is clear that depending on the big-endianness/little-endian result may be different.

I found short and funny example:

#include <iostream>
int main()
{
    for (int i = 0; i < 300; i++)
        std::cout << i << " " << i * 12345678 << std::endl;
}

Being compiled with -O2 on modern g++ it will run infinitely. Suddenly, right?

Full text and comments »

Tags g++, ub
  • Vote: I like it
  • +257
  • Vote: I do not like it

By MikeMirzayanov, history, 8 years ago, translation, In English

ACM-ICPC World Finals 2016 will take place on May, 19, 03:00 (UTC). It is one of the most important events in programming competitions life.

More than 40000 contestants from 2736 universitites from 102 countries had competed in regional competitions. 128 teams had advanced to the World Finals, which are held this year in Phuket, Thailand. Soon we will know which university takes home the most prestigious title in programming — the tile of the World Champion of ACM ICPC!

Useful links:

I wish the teams good luck and many baloons!

Full text and comments »

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

By MikeMirzayanov, 8 years ago, translation, In English

The Finals of ACM-ICPC 2016 in full swing! Teams and organizers gathered in Thailand. The weather is fine — heavy showers at nights, hot days. The rainy season is in action. Here it is about two a.m. now, but as I absolutely can not sleep, I decided to share my impressions and photos from the first two days of the main event.

This year, the teams' resettlement delivers certain inconveniences — teams and coaches live in the same hotel, and all the other members of the delegation live in another. The first hotel (Le Meridien), is probably a bit better — own way out to the ocean and pool make everybody to envy those who lives in the Mövenpick (yes, like an ice cream).



Le Meridien, photo from the official hotel website

Buses ply between hotels, you need an hour to go. A bit uncomfortable that the buses do not run every day, or at least not always, only as scheduled.

Full text and comments »

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

By MikeMirzayanov, history, 8 years ago, translation, In English

On May, 5, 16:05 (UTC) Codeforces Round 350 is going to start! Yes, pay attention to the non-standard start time.

I took advantage of my official position and the round is expected to be a bit experimental with an expanded set of problems. Perhaps for experienced participants (sorry, Div 1) it could seem easy. This time, emphasis was placed on the main target audience of the round: so in the round will be a lot of very simple problems, but even the top of the second division will find something interesting. In addition, one of the problems will be offered in two versions — in a simplified version with small constraints and in a harder version with greater constraints. Thus, if you immediately realize solution for large constraints, you can write and submit the same code on the both version.

The problem writers are me and fcspartakm. We hope that you will enjoy the problems and the round will be fun and useful!

The expected scoring is:

  • A: 500
  • B: 750
  • C: 1000
  • D1: 1000
  • D2: 500 (i.e. the complete solution of D is 1500 points)
  • E: 2000
  • F: 2500

Good luck!

UPD: As it was pointed in the comments we have a tricky point about hacks with problems D1/D2.

  1. To avoid the situation when participant locks the problem D1 and looks the solution of the problem D2 in his room, you are allowed to lock the problems D1/D2 only together in the same time and only if both of your solutions for this problems passed the pretests. In the other words, the possibility to lock D1/D2 will appears only after you solved both problems. The problems D1/D2 will be locked together in the same moment.

  2. To avoid the situation of double reward for hack of D1 and D2 of the same participant, the participant A after successful hack of the participant B on the problem D1 loses the possibility of the hack B on the problem D2. Similarly if the participant A successfully hacks the participant B on the problem D2, then A loses the possibility of the hack B on D1.

UPD 2: The round is over. My congratulations to the winners! Here are the heroes of the round.

The Top-5 among the official participants:

  1. xlk200
  2. TableEnterer_Lin
  3. cykhhq595
  4. xxxholic
  5. A_Navie_Moer

The Top-5 among the unofficial participants:

  1. anta
  2. -XraY-
  3. Um_nik
  4. halyavin
  5. Enchom

UPD 3: Problem analysis is now available.

Full text and comments »

Tags 350
  • Vote: I like it
  • +466
  • Vote: I do not like it

By MikeMirzayanov, history, 8 years ago, translation, In English

April 25, 18:00 (UTC) the second Wild-card round of VK Cup 2016 will take place.

Participants are invited to achieve progress in solving an unusual problem. VK Cup teams which were advanced to the Round 2 (and didn't advance to the Round 3) will take part in VK Cup 2016 - Уайлд-кард раунд 2 officially. In addition, this round will be open to the public for unofficial participation for everybody. Registration will be open for the whole round duration.

The round will be one week long. After the end latest submission (with positive score) of each participant will be judged on system tests.

Good luck!

UPD 1: Unfortunately, it turned out that most of current tests were not various enough and did not cover different scenarios of the testing system. Tests in the system have been updated, all submissions will be rejudged. Perhaps the rejudging process will take some time. In addition, the scoring function has been updated (its monotony maintained). Because of this, points for your submissions changed a bit. The restriction on the number of submissions has been added (up to 20000). Check out the updated statement for details.

Full text and comments »

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

By MikeMirzayanov, history, 8 years ago, translation, In English

Hello!

Last weeks I was concerned (and probably, you too) about abnormal rating growth of our leaders. Of course, first of all I'm talking about tourist, his rating is just rushed into the sky.

There were even comments from a series of "I told, and it happened"

After the first round of VK Cup 2016, I carefully investigated the reasons of such growth and found a simple and trivial bug in the rating formulas. It's funny that even after being published, nobody found it. Look at this function:

    private double getSeed(List<Contestant> contestants, Contestant contestant, int rating) {
        Contestant extraContestant = new Contestant(null, 0, 0, rating);
        double result = 1;
        for (Contestant other : contestants) {
            result += getEloWinProbability(other, extraContestant);
        }
        return result;
    }

Remind, this feature is to calculate the expected participant place, if its rating suddenly became equal to rating. Of course, it should not take account of the participant itself (to whom we currently assign new hypothetical rating). The correct code must be:

        for (Contestant other : contestants) {
            if (other != contestant) {
                result += getEloWinProbability(other, extraContestant);
            }
        }

This bug led to the fact that taking the first place tourist actually won a very serious opponent. Himself. This led to a significant increase in its rating, even if the first was quite expected.

The good news is that this bug has a statistically significant effect only in the very rare cases when the winner (or close to the winner) had a very high rating (yes, contrary to "anti-heroes" is also true). If we take an arbitrary round and recalculate the rating formulas corrected, almost all participants will receive exactly (or very close) rating.

After consulting with tourist and Petr, I came to the following plan of action:

  • Today we had chronologically recalculated all ratings from the revolution of 2015,
  • If difference between the change according to the corrected rating formulas and the historical change (according to formulas with a bug) is no more than 3, the historic change continued to be used,
  • If difference between the change according to the corrected rating formulas and the historical change (according to formulas with a bug) is more than 3, the change is replaced with the correct rating in history.

It turned out that this bug did not affect practically all users. Bug touched only the top. I apologize to those who had descended from heaven to earth — but it was impossible to leave it as is. I wish leaders to get those ratings that were before rating fix.

Mike.

Full text and comments »

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

By MikeMirzayanov, history, 8 years ago, translation, In English

Sentimental moment for me: going through old things I've found something ancient

What most ancient (or most ancient) contest t-shirt do you have?

Full text and comments »

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

By MikeMirzayanov, history, 8 years ago, translation, In English

Hello.

Now it became much unlikely to skip a round due to carelessness during the registration. In the coming rounds (in experimental mode) we will add new feature extra registration (it is good terminology? additional registration?).

This means that after the period of regular registration (as usual, 5 minutes before the start of a round it will be closed) there will be another additional period of registration. It will start in 10 minutes after the start of the round with duration of 20 minutes, that is, it will close after 30 minutes from the start of the round.

The role of the 10 minutes is twofold:

  • on the one hand it is quite possible to solve the easiest problem in the first 10 minutes — so it makes a motivation to register on time,
  • on the other hand the system is loaded much during the first minutes of a round, as a registration invalidates some internal caches it is better to open extra registration after 10 minutes.

When registering during the extra time a participant is automatically assigned to a random room (among suitable for its role).

Full text and comments »

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

By MikeMirzayanov, 8 years ago, translation, In English

The Qualification Round of the "CROC 2016" Championship will start on March, 16, 09:00 (UTC).

Please, read about the Championship by the link http://codeforces.com/blog/entry/43229

You need to participate in the Qualification Round to make it to Round 1. All contestants who gain a positive score will advance to the Round 1.

At the Qualification Round you will find a few problems, roughly ordered by the increasing complexity. During the Qualification Round the problems are judged only on pretests and system testing will take place after the end of the Qualification Round (round continues for 48 hours). The pretests do not cover all possible cases of input data, test your programs carefully! The Qualification Round has no hacks or decreasing values of the problems.

The round will last for 48 hours, but it does not mean that we encourage you to spend all this time solving of problems. We hope that most participants will cope with the problems (or with most problems) in a shorter period of time. This duration of the round is chosen so that each participant could find a convenient time to participate. The problems will be in English as well as in Russian.

Before the end of the round it is strictly forbidden to publish the problem statements/solutions/any thoughts and ideas about them elsewhere. It is forbidden to talk about the problems, discuss the statements and so on. Be honest and let the best participants make it into Round 1. When the Qualification Round is over, you can discuss the problems and solutions.

You can register for the round at any time up to its end.

The results of the round will not affect the rating. If you are not registered to the Championship officially, you can take part in the round out-of-championship.

Best of luck and enjoy solving the problems!

Full text and comments »

Announcement of CROC 2016 - Qualification
  • Vote: I like it
  • +116
  • Vote: I do not like it

By MikeMirzayanov, 8 years ago, translation, In English

Hello, Codeforces!

In the spring 2016 the company CROC together with Codeforces will hold the third Russian Open programming championship «CROC – 2016». The goal of this project, as before, — encourage of the most talented and innovative young specialists and stimulate interest to the information technology.

As usual CROC company pays great attention to social projects, associated with the development of the IT-industry, to promotion of IT-professions and to the increasing interest in modern technology. CROC has rich experience of cooperation with universities, the organization of courses, seminars and competitions for pupils, students and experienced professionals.

The registration to the championship will be open from March, 1st to March, 16. Anyone, regardless of nationality, place of residence and level of education, can be a participant. The official language of the competition is Russian. Championship participants will take part in two main rounds: elimination round, which will take place in early March, and the final. There will be 50 strongest participants competing in Moscow on April, 15. CROC will cover transport costs in the amount of no more than 10000 rubles (it is about 135 USD). All finalists should confirm their will and ability to visit Moscow to take part in the Final before March 25. CROC will not be able to help you with visa (if it needed), so our primary target audience is Russian participants and participants from some ex-USSR countries. But two years ago rng_58 visited our Finals!

A warm welcome, meeting with the organizers of the event and experts in software development in the CROC, a festive buffet, a fascinating game round and great prizes and gifts are waiting for the finalists. Previous programming championship by CROC was held in 2013 and brought together ~3500 programmers from all over Russia, CIS and other countries.

Prizes

  • 1 place — 100000 rubles
  • 2 place — 70000 rubles
  • 3 place — 50000 rubles

The prize for the winner of the game round is a laptop.

Schedule stages of the championship

  • Qualification Round – 16 of March
  • Elimination Round – 18 of March
  • Finals will be held on April 15 in Moscow in the office of the CROC (50 participants)

All rounds will be open for unofficial participation for everyone. The Elemination and Finals rounds will be rated regardless of participation type (official or not).

Registration

To take part in the championship you have to register on the special page. Registration will be open until the end of the qualification round. Compete with the best programmers in the Open Championship "CROC-2016"!



Register Now!


The history of the CROC championships

The upcoming championship will be the third championship, conducted by the CROC on Codeforces. You can find the information about this championships by clicking on the links below:

Full text and comments »

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