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, second, third, and fourth Kotlin Heroes competitions which were held previously: Episode 1, Episode 2, Episode 3 and Episode 4.
Ready to challenge yourself to do better? The Kotlin Heroes 5: ICPC Round competition will be hosted on the Codeforces platform on Nov/12/2020 17: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.
Prizes:
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 sticker, competitors solving at least one problem will enter into a draw for one of 50 Kotlin Heroes t-shirts.
Everyone who takes part in this round will get an electronic Participation Certificate.
There is also a special recognition prize from the ICPC: ICPC- experience, an invitation to the Moscow World Finals 2021, all-inclusive on-site (hotel, meals, ceremonies, and swag, are included; visa, flights, transportation to the contest location is not).
Registration is already open and available via the link. It will be available until the end of the round.
The round will again be held in accordance with a set of slightly modified ICPC rules:
- The round is unrated.
- The contest will have 9 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.
If you are still new to Kotlin we have prepared a tutorial on competitive programming in Kotlin and Kotlin Heroes 5: ICPC Round (Practice), 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.
UPD: The editorial can be found here.
Aim for the T-shirt!
True lol
No DIV 2 contest before 13/Nov. :-(
I have a question about the new electronic certificate: Is the real name printed on the certificate or just the handle on cf?
I don't know how to use Kotlin :-(
And there is no other contests until Nov.13 :-(
[deleted]
If you can write basic code, you can simply look up kotlin input/output format and solve the first one or two easy problems to be entered into the lucky draw for t-shirts, so there's really no reason to complain.
Learnt Kotlin yesterday to participate because I am bored
Learnt Kotlin during contest because I want t-shirt
This announcement blog is not added to the Kotlin Heroes Page. Please add it there also.
BledDest
I don't get the reason for promoting a particular language (funding ?). I would be happy if it was some normal $$$choose\ the\ language\ you\ like$$$ contest.
Kotlin is a product of the company Jet Brains. As part of their business they provide tools and services related to kotlin.
It is therefore of fundamental importance for the company that people learn and use Kotlin. That is the reason why they pay to create a contest exclusive for Kotlin.
Makes sense obviously from the Jet Brains perspective, but by allowing such thing codeforces is doing something way too different from what it is known for. Also while upsolving I see it has restriction of kotlin it feels bad and annoying.
And I fear that the long contest drought maybe to facilitate more participation in this kotlin promoting saga (I hope not). Yeah I know it codeforces is too good a place to say -ve things about but couldn't resist objecting.
To upsolve the problems in a different language, you can create a mashup and add problems from Kotlin contest there. That way, they can be solved with any language.
Doesn't seem like it, I can't see any solutions.
How do you win ICPC prize?
The winner of the Kotlin Heroes X ICPC round will win the ICPC experience, an invitation to the Moscow World Finals 2021, all-inclusive on-site (hotel, meals, ceremonies, and swag, are included; visa, flights, transportation to the contest location is not)
Need Help ASAP!!
Following code Throws a runtime error on test 1 for the problem A+B (Trial Problem) in Kotlin Heroes 5: ICPC Round (Practice):
[contest:1432][problem:A]
n and m are on same line so :-
val (n,m) = readLine()!!.split(" ").map{it.toInt()}
noooo, I didn't know it could only be written in kotlin. is this rated?
yaaaaaay, it isn't rated, I just readed it
What is wrong with this:
The compiler says:
Well, I was able to solve the sorting issue, the problem seems to be that there is no default sorting for Pair, so we need to define the comparator.
However, shortly after I was stuck googling "kotlin how to add element to sorted set" and was not able to find a way in contest time :/
This mutable/unmutable collections things do not look very practical to me.
I think the chance of getting the lucky t-shirts should increase with the number of problems you solved to encourage people to solve more problems.
Learnt to take input output in kotlin one hour after the contest begun and somehow managed to write correct code first problem . Learning the syntax of language during the contest was too much fun..
you could write in java and could use converter to convert to kotlin )
Enjoyable contest — my first time (except for the practice round) doing Kotlin. Thanks to the organisers.
Is there a greedy solution to problem G?
I had never written a line of Kotlin before last night--suffice it to say that I'm glad I gave it a try!
I thought a lot of the problems from this round were very high-quality, but I especially enjoyed solving I--I had never seen the trick enabling us to maintain a trie while deleting the first letter of each word, and I thought it was quite clever and elegant. Thanks to the authors for the round and to JetBrains for sponsoring the contest!
Ok, so there IS a solution without any suffix structures, good to know!
You don't need to compare suffixes from distinct columns, thus suffix structures are not required indeed: for each column from right to left, you can build a sorted list of suffixes starting in it, pretty much like radix sort.
Indeed there is! A slightly more detailed explanation of my solution, in case anyone's curious:
First, observe that the problem reduces to determining the minimum number of times you must switch rows in order to write the query string using characters from the corresponding columns of the input matrix. For example, in the last query of the first sample case, we can take "a" from the first row, then "cbb" from the second row, then "c" from the first row (or either of the third or fourth rows).
We can use a greedy approach--basically, for each query, pick the row where we'll be able to take the most matching characters before switching rows. It remains to figure out how to quickly determine which row that is and how many matching characters we can take.
Our approach uses a trie. Construct a trie using the $$$N$$$ rows of the input matrix as our input strings. Then, feed each query string into this trie to figure out how many matching characters we can take before we have to switch rows for the first time.
Now, if we could construct similar tries starting at each remaining column of the matrix, we could use a similar approach to figure out how many times we have to switch rows for all queries in $$$O(QM).$$$ It turns out that this is possible. Basically, we need to process updates to the trie in which we delete the first character of every string. We can do so by deleting the root node and merging all of the tries created as a result. To merge two tries, we iterate over all possible letters that can follow the root. If only one of the tries has a node corresponding to that letter, that node goes in the merged trie. If both of the tries have nodes corresponding to that letter, then we merge those subtries and put the result in the merged trie.
Since merging two trie nodes requires a constant amount of work and there are $$$O(NM)$$$ trie nodes, these merges work in $$$O(NM)$$$ time in total. Then, we spend $$$O(M)$$$ time in total feeding each query into the appropriate tries, so our total time complexity is $$$O(M(N+Q)).$$$
Happy to answer follow-up questions if any of this was unclear!
Very cool indeed, thank you!
The contest has 10 problems, not 9)
What is test 164 of problem I :(
I can't describe what I tried to do with that test (a desperate attempt to hack some tester's solution), but maybe the source code of the generator can help:
It is being run with arguments
2 250000 2
.Is it always optimal for Bob to take the smallest possible number in G?
Yes (at least I got AC this way)
Congratulations to tourist yet again!
Can someone explain the gameprocess in the second testcase in G?
1). Alice chooses 109, Bob chooses 200
2). Alice chooses 108, Bob chooses 201
3). Alice chooses 1, Bob chooses 100
(201 — 108) + (200 — 109) + (100 — 1) = 283
If we take
seed = 346
(penalty of tourist) andlen = 700
(total participants except first 50) the winners of random Kotlin T-shirt are:56 90 106 111 132 138 158 200 243 245 256 263 270 317 324 339 346 347 359 365 395 403 414 420 422 426 454 457 487 494 503 506 513 551 568 585 595 597 609 616 647 671 672 682 684 695 703 704 705 716
(Information from this comment).
Upd. for new
len = 687
new list is:62 68 74 100 138 141 147 156 184 230 233 239 260 268 287 294 296 301 323 327 353 361 368 376 383 395 398 412 416 431 438 446 450 457 470 472 486 514 535 610 611 622 645 648 653 666 673 695 709 718
In final rank there are no 513th rank. two people got 512th rank. How to select 513th rank for random t-shirt winner?
the ties are broken by the last submission time, if I remember correctly
deleted
deleted
the standings show people tied in random order iirc, don't mind them too much
deleted
remove cheaters?
In the Rank 645 , there are three people, who will got prizes then?
Don't think so
How has the length changed after so many days? Did they catch some cheaters?
I think yes, some cheaters definitely have been removed.
Why len=687? It should be 737 — the total number of participants solved at least 1.
Your comment here states that The seed will be the total penalty best participants of this contest, the parameter length will be the total number of participants solved at least one problem minus 50.
Currently, we use randgen.cpp by KAN, it has other semantics for
len
.deleted
john cena
amazing contest, glad to take the practice round first :)
Thank you for the contest, it was really nice one! And I like kotlin and appreciate all your efforts to develop such a nice language, my favorite one ❤️
When will we receive our certificates and can anyone update me about the t shirt?
Who are the thsirt winners?
MikeMirzayanov When the prize winners will be announced?
Tagging BledDest and MikeMirzayanov
BledDest MikeMirzayanov JetBrains
Did you guys just forgot about the random T-Shirts?
just wait.
Legend Master Farhan132
When and how will the certificate arrive
I guess on 30th February by pigeon post, but don't take that for granted.
Feb? Do you want to say Nov
30th in Feb...(this is a joke)
I have got a message that my code has been matched with some random person who was also giving this compitition, I don't know how this happened, this might be coincident but I just want to confirm that I don't know that person nor I have any contact with him/her. Please recheck your system and consider me in this competition.
which submission? give link
98219728 and 98220972 . There are two same codes, that are not trivia, so maybe you used ideon of smth.
And these two accounts have the same code for all the problems of practice contest.... Now it's obvious that it's cheating.
Not well, this is some kind of disrespect for the codeforces community in general — sad of course ... But if there are problems with cheating, then let us (participants) know that the results will be later, many participants are waiting for the results ...
I apologize for the delay. And finally, with fanfare and drums, I publish the lucky ones who get the T-shirts.
Wow it's definitely the best new for me in this November morning! Thank you the Codeforces Platform! Besides I have a question: how would the T-shirt be posted to prize-winner? thx for your replying
Where is the list of the those people who have won the T-shirts. Also wanted to know where can we access the online Certificate?
Check message above.
When and how are we going to receive certificate
Here you go.
Not Cool dude,the fact is i thought it was real.even though title is wirtten as Hotlin. But I genuenly asked for certificate
Sorry mate. I thought it was obvious.:D
It's OK mate but seriously do you know when our certs are going to arrive
I participated in Kotlin Heroes 2,3,4,5, and don't remember getting a certificate, so I don't think you get it automatically.