Hello, Codeforces!
First and foremost, we would like to say a massive thank you to everyone who entered and submitted their answers to the first and second Kotlin Heroes competitions which was held previously. Congratulations to the top 3 winners:
Episode 1
Episode 2
Ready to challenge yourself to do better? The third "Kotlin Heroes" competition will be hosted on the Codeforces platform on Feb/27/2020 16:35 (Moscow time). The contest will last 2 hours 30 minutes and will feature a set of problems from simple ones, designed to be solvable by anyone, to hard ones, to make it interesting for seasoned competitive programmers. Top three winners will get prizes of $512, $256, and $128 respectively, top 50 will win a Kotlin Heroes t-shirt and an exclusive Kotlin badge, competitors solving at least one problem will enter into a draw for one of 50 Kotlin Heroes t-shirts.
The round will again be held in accordance with a set of slightly modified ICPC rules:
- The round is unrated.
- The contest will have 6-10 problems of various levels of complexity.
- You are only allowed to use Kotlin to solve these problems.
- Participants are ranked according to the number of correctly solved problems. Ties are resolved based on the lowest total penalty time for all problems, which is computed as follows. For each solved problem, a penalty is set to the submission time of that problem (the time since the start of the contest). An extra penalty of 10 minutes is added for each failed submission on solved problems (i.e., if you never solve the problem, you will not be penalized for trying that problem). If two participants solved the same number of problems and scored the same penalty, then those of them who had previously made the last successful submission will be given an advantage in the distribution of prizes and gifts.
Registration is already open and available via the link. It will be available until the end of the round.
If you are still new to Kotlin we have prepared a tutorial on competitive programming in Kotlin and a practice round, where you can try to solve a few simple problems in Kotlin. All the solutions are open, which means that you can look at the solution even if you haven't solved the problem yet. The practice round is available by the link.
We wish you luck and hope you enjoy Kotlin.
So cool
good luck!
I've written a blog with some notes about using Kotlin in competitive programming.
Note that Kotlin Heroes rounds tend to be more generous than usual rounds on the time limits.
Good luck to everyone!
Can previous winners get prizes one more time?
Yes, the winners will receive their prizes regardless of their participation in the previous rounds.
The link for the practice round is wrong. It references Kotlin Heroes Practice 2. There is a Kotlin Heroes Practice 3 here
Going to take t-shirt
map < int, int > mp;
mp[10] = 2;
mp[10]--;
if(mp[10] > 0) cout << "yes";
else cout << "no";
Can anyone convert this c++ code into kotlin?
yes
Here you go:
In C++
mp[10]
would create a missing key with a default value, so the true Kotlin equivalent tomp[10]
in C++ ismp.getOrPut(10) { 0 }
. However, this code assumes that we definitely have the element in the map, so it would be truer to its spirit to writemp[10] = mp[10]!! - 1
ormp[10] = mp.getValue(10) - 1
.The other is that there's really no reason to replace
if
withwhen
. In Kotlinif
works just as well as in C++.P.S. There are no C++-style maps that would create missing elements in Kotlin out-of-the box, but you can easily write one yourself and then write your code just as you did in C++, e.g. you would be able to write
mp[10]--
just as you did in C++. See the example here: https://pl.kotl.in/v8JTqsAe_(Oh my God! Roman Elizarov wrote a response to me!)
Of course you're right, I guess I made a too high-level translation, trying to also convey my own perception of Kotlin's functional/call-by-reference/null-safe spirit.
I like how in Kotlin, like in C++, you can go as high or low-level as you need, and mix and match such code as it is convenient.
P.S. Didn't know that
mp[10]--
was possible in Kotlin.Guys, I wanna ask shouldn't the random prizes be only for non-new IDs to prevent people from making fakes just for this contest(to increase chances in random). PS: Was motivated to write this after seeing unusually high number of black IDs on the leaderboard
+1 Would be nice to block those fake IDs
Such things should be clarified before the contest. Elsewhere, it will not be fair to the participants which decided to register here just to take part in this particular contest.
Yeah bro, I totally respect the people who made an ID just for this maybe, but I just was talking about some people including multiple fake IDs to win.
And I totally get it that rules should be pre-declared, all I'm saying is there should be some counter-measures to stop this immoral and unethical practice!
Yeah, I fully agree that such behavior is against the spirit of competition because it gives some users more chances to get prize and I agree that we need to do something with that. The question is how we can prohibit that? Proposed way to exclude new users from the raffle is not appropriate because of:
When can I submit >:(
You can now ;)
Can someone run the program about random winners please?
https://codeforces.net/blog/entry/69419?#comment-541391
first — 451, second — 650.
62 64 65 74 76 82 103 115 122 129 147 149 167 191 201 207 223 224 244 264 281 285 306 308 318 320 330 332 343 345 356 363 396 422 423 439 440 452 476 483 486 488 514 538 550 594 601 605 633 640
oh, sorry, second is 600. I forgot to -50. Can you update your comment?
updated
thanks )
is it 100% results? or just a prediction?
100% results are here
The hardest thing is to make a valid comparator fo TreeSet in "F".
Can anybody give me expl of such comparator for TreeSet for Pair<Int, Int>(comp must work as usual sort)?
I've found such thing:
var opened = TreeSet<Pair<Int, Int>>(compareBy({it.first}, {it.second}))
(The type of the TreeSet is inferred by the type of the comparator)
(the type of the PriorityQueue is inferred from the type of the comparator)
Is it possible to submit now out of contest? OK, apparently NOW :D
When will the cheaters be dropped from the standings and most importantly, when will the winners be announced?
Screencast
Our congratulations to the t-shirt winners (top 50 + random 50)!
Why new fake accounts get prize?
16 Black IDs out of random 50 T_T
16 This is too much, If they are removed, we will have another chance.
Yeaaaaaa....:(
I'm NOT a fake account. I'm new to codeforces but I have been using Kotlin for my personal development for a while. Please don't judge an account by its color.
Sorry bro, didn't really intended to offend anyone, already said that I respect everyone who gave it fairly, just still don't u see an unusual number of new IDs?
The unusual number of new IDs for Kotlin Heroes contest was to be expected. This contest was specifically designed to attract developers who never had prior competitive programming experience before and was marketed by JetBrains throughout a very large Kotin developer community.
Oh very well, hopefully there will be much more new registrations in Kotlin Heroes episode 4.
when we will get our t shirts?? Is there any procedure to complete for getting t shirts??
I can't give you details for this contest, but from my experience with other contests: you will get contacted, either per eMail or private message. Depending on the organizer this may take 2-3 days or even more than a month in some cases, 9 months till it finally arrived :(. I'm not saying that it will take that long (I really don't know in this case), just don't get nervous when you have to wait a bit.
Then you have to provide your address and tshirt size (replying to the message directly or filling a web form).
Based on the previous two experiences, in about two months System will remind you via Talks to check and be sure that your profile contains complete and actual information about t-shirt size and shipping address. About another month after that the T-shirt will be sent from Russia and System will give you the tracking code.
It would really help if the organizers could give out online certificates, in pdf format, for the participants with their respective ranks.
Is there any chance of getting a T-shirt for those having a Tie? @Suifeng0214 and me have the same rank but unluckily i am not selected.
https://codeforces.net/blog/entry/67162?#comment-514253
"(tie are resolved by last accepted submission time as in ICPC)"
I think, that need more t-shirts
:v
I share rank 363 with NewUser0. Will I get t-shirt?
https://codeforces.net/blog/entry/67162?#comment-514253
"(ties are resolved by last accepted submission time as in ICPC)"
good luck everyone!
Hello :) Thank you for a cool contest. Will there be an editorial, please?
It's here
any reliable sources for learning kotlin? please help.