By BledDest, 2 months ago, In English

Greetings Codeforces!

First things first, we would like to thank everyone who participated in the previous nine Kotlin Heroes competitions: Episode 1, Episode 2, Episode 3, Episode 4, Episode 5: ICPC Round, Episode 6, Episode 7, Episode 8, Episode 9, and Episode 10.

Kotlin Heroes is a great way to play around with Kotlin’s features, learn something new, and practice using the language by solving fun problems. It is great for programmers of any level!

We invite you to join the practice round, where you can improve your algorithmic problem-solving skills and complete training problems. In this round, all the solutions are open and you can request hints if you’re stuck.

Watch tourist and ecnerwala tackle the Kotlin Heroes practice round challenges at the ICPC World Finals in Astana.

Here are some things you can do to help you refresh your knowledge of Kotlin and learn more about competitive programming while you practice:

On September 30, 2024, the real challenge begins! Kotlin Heroes: Episode 11 will last 2 hours 30 minutes and will feature a set of problems ranging from simple ones, which are designed to be solvable by anyone, to some really tricky ones for seasoned competitive programmers.

Note that the usage of AI-based tools during the main contest is strictly limited. To find out the guidelines for proper AI use, what is allowed and what is prohibited, please read the post "Rule Restricting the use of AI". Improper use of AI tools during the main contest may result in disqualification.

Using automatic translation tools (including but not limited to neural networks and AI) to convert code written in other programming languages to Kotlin goes against the spirit of the competition, so it is also strictly prohibited.

REGISTER →

Prizes:

The top three winners will receive cash prizes of $512, $256, and $128 (or rewards of equivalent value), respectively. The top 50 participants will win a Kotlin Heroes T-shirt and an exclusive Kotlin sticker, and all competitors who solve at least one problem will be entered into a raffle for one of 50 Kotlin Heroes T-shirts.

Please note that we are not able to ship prizes to any country, state, province, or territory subject to comprehensive OFAC sanctions, including Belarus, Cuba, Iran, North Korea, Russia, Syria, or the Crimea, Donetsk, or Luhansk regions. To see the list of sanctioned countries and regions, please visit this page.

Best of luck to everyone!

Announcement of Kotlin Heroes: Episode 11
Announcement of Kotlin Heroes: Practice 11
  • Vote: I like it
  • +103
  • Vote: I do not like it

»
2 months ago, # |
Rev. 4   Vote: I like it +26 Vote: I do not like it

Not relevant to me, but please clarify if language translations from other languages into Kotlin are allowed. (And also clarify for language translations on CF in general). It is not explicitly ruled out in the “Rule restricting the use of AI” blog, and it is debatable if it falls under allowed cases.

(Edit): For this contest it is quite clear that it should not be allowed. I personally think language translations in general should not be allowed. The reasoning is too long for me to summarizes in this short comment.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it -8 Vote: I do not like it

    This is probably not allowed, considering the allowed language is Kotlin only. If this were allowed, they would just open it to new languages. Why would you make it Kotlin only then allow people to convert?

    just my take

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I agree, it will be very silly if it is allowed in this contest in particular.

      I was going to say why in general it should not be allowed on CF. I will update my comment as I omitted this.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it -8 Vote: I do not like it

    It's not too long. This is a Kotlin only contest

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +19 Vote: I do not like it

    Automatic translation from other programming languages to Kotlin is not allowed. I've added this information to the announcement.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it +18 Vote: I do not like it

      Thank you for the clarifications.

      I find it funny to see that the Intellj Java to Kotlin converter (which is the only other good non-AI translator I can think of), is now banned collaterally — something that had been used for 5 years already ever since the first Kotlin Heroes.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it +16 Vote: I do not like it

      Can it be more publicly announced? Right now, it is hiding in a small portion of an announcement

      Especially because previously contestants did do it and were not penalized.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Thank you for your comments and questions! Since the goal of the contest is to encourage participants to try Kotlin, we ask that you do not use AI to solve the problems or translate solutions from other languages.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Since language translation is not allowed, does some know any quick source of learning the basics of kotlin? like in an hour or something

»
2 months ago, # |
  Vote: I like it -10 Vote: I do not like it

is it rated?

»
2 months ago, # |
  Vote: I like it -13 Vote: I do not like it

Is it rated?

»
2 months ago, # |
Rev. 2   Vote: I like it +5 Vote: I do not like it

This contest is not rated, But If you can solve at least one problem, you'll have a chance to win a t-shirt

»
2 months ago, # |
Rev. 3   Vote: I like it +1 Vote: I do not like it

https://ibb.co/ggmMyP6 Can I know when I'll get my t-shirt?

»
2 months ago, # |
  Vote: I like it +5 Vote: I do not like it

thanks to everyone involved for helping me realize how superior c++ is

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    Thats just me every time I go close to something like java.

»
2 months ago, # |
  Vote: I like it +5 Vote: I do not like it

if you search for an online IDE https://onecompiler.com/kotlin this works well.

I struggled a lot for finding a working website at the beginning of the contest. so here you go for the future contests.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    much appreciated as i struggled in the beginning myself!

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Is it normal to use java ArrayList over the Kotlin native List?

Not very familiar with Kotlin... was just using what ever compiles.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You can but there is not much reason to I think. Kotlin data structures are more convenient, e.g.:

        val xs = listOf(1, 2, 3)
        val mxs = mutableListOf(1, 2, 3)
        val kotlin_map = mapOf('A' to 1, 'B' to 2)
    

    Since you have immutable data structures you can also do reliable hashing, etc.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Thanks for the answer! I wanted to make an empty list, and the compiler was complaining about type inference.

»
2 months ago, # |
  Vote: I like it +32 Vote: I do not like it

problem G is really funny troll problem, made my day lol

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I'm curious why my O(N) solution to E is getting TL. Is there something particularly slow in Kotlin among the things I'm doing?

Code
  • »
    »
    2 months ago, # ^ |
      Vote: I like it +2 Vote: I do not like it

    It's quadratic: String+Char creates a new string. Use StringBuilder instead.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Hell, forgot about this Java shit with strings. Thanks a lot!

»
2 months ago, # |
Rev. 2   Vote: I like it +4 Vote: I do not like it

Why I can't see solutions submitted by other contestants after contest? No open-hacking phase? No tutorial?

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Will it be possible to submit solutions after the contest?

»
2 months ago, # |
  Vote: I like it +65 Vote: I do not like it

Thank you for participation! We hope you enjoyed the problems.

The current version of the editorial (no problem I, some other problems might be unpolished) is available here.

Also, these are our model solutions to the problems:

Spoiler
»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

After the entire contest, I realized there is only one sheep in problem D LOL :(

»
2 months ago, # |
  Vote: I like it +22 Vote: I do not like it

This was my first time trying Kotlin and participating in the Kotlin Heroes contest. It was a great experience, and I enjoyed it so much! I'm looking forward to joining future contests and improving my skills in Kotlin.

Here are the resources I used to learn Kotlin:

  1. Kotlin Tour

  2. Kotlin Koans

  3. Kotlin for Competitive Programming

Thanks for the awesome contest and the great problems!

»
2 months ago, # |
  Vote: I like it +10 Vote: I do not like it

It was fun trying out Kotlin, got mixed up with types a lot. I had this problem where I did a for loop and compared i to a long value inside, so it autoconverted i to long and then all of my array indexing with i threw errors, I was so confused for a good bit lol

»
2 months ago, # |
  Vote: I like it +10 Vote: I do not like it

I definitely needed more time learning types and Kotlin syntax but I will say using the IntelliJ IDE made this contest feel very fun and refreshing. Very cool problems too, even though I didn't get to solve the harder ones, I liked the problems I was reading.

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Are the raffles selected yet? Or will only the winners know?

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Is it possible to continue submitting code to practise round? It shows contest is over.

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Why can't we view the solutions of other participants???

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Can I solve the problems in any language or only kotlin?

»
7 weeks ago, # |
  Vote: I like it +6 Vote: I do not like it

Hi BledDest are the raffles seleceted yet for tshirts...?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    I guess yes but I am not sure as I received a text regarding prize and there has been no follow up since then, the text was something like :

    "Hello, frissky9! We are pleased to inform about your award for "Kotlin Heroes: Episode 11".

    Congratulations!"

    waiting for updates! BledDest

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      I don’t know why no one has posted/commented about it yet, but here’s the message I received from System.

      Message
»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Who are the winners, can you explain, 2 weeks have been passed.