Автор BledDest, 3 года назад, перевод, По-русски

Hello, Codeforces!

First and foremost, we would like to say a massive thank you to everyone who entered and submitted their answers to the five Kotlin Heroes competitions which were held previously: Episode 1, Episode 2, Episode 3, Episode 4, and Episode 5: ICPC Round.

Ready to challenge yourself to do better? The Kotlin Heroes: Episode 6 competition will be hosted on the Codeforces platform on 09.03.2021 17:35 (Московское время). 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.

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.

REGISTER →

If you are still new to Kotlin we have prepared a tutorial on competitive programming in Kotlin and Kotlin Heroes: Practice 6, where you can try to solve a few simple problems in Kotlin. The practice round is available by the link.

We wish you luck and hope you enjoy Kotlin.

  • Проголосовать: нравится
  • +168
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится +29 Проголосовать: не нравится

Could you set -jvm-target kotlinc flag to 1.8+ (default is 1.6)?

Currently it's impossible to use static methods on interfaces (e.g. Comparator.reverseOrder()).


import java.util.Comparator

fun main() {
    val list = mutableListOf("Hello", "World")
    list.sortWith(Comparator.reverseOrder())
    println(list)
}

fails with

Invocation failed [COMPILATION_ERROR]
Can't compile file:
program.kt:5:30: error: calls to static methods in Java interfaces are prohibited in JVM target 1.6. Recompile with '-jvm-target 1.8'
    list.sortWith(Comparator.reverseOrder())
                             ^
Unable to find classes\programkt.class 
»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I just have a question how can we change a char in a string in kotlin.. why its so wrong to do it like other languages
s="hold"; s[0]='g' that just doesn't work

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    the strings and a lot of other objects are immutable for simplicity. For example, it simplifies the creation of a substring — just put the pointers at the beginning and end of the substring

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится +11 Проголосовать: не нравится

    If you need a mutable String-like object, try StringBuilder.

    val s = StringBuilder("test");
    s[0] = 'g';
    s.append(s);
    println(s); // gestgest
    
»
3 года назад, # |
  Проголосовать: нравится -56 Проголосовать: не нравится

can i use c++ in this contest??

»
3 года назад, # |
  Проголосовать: нравится +16 Проголосовать: не нравится

Note-People who won’t be able to participate in the contest, and want to solve the problems afterwards in their favorite languages can create mashups and do that.

»
3 года назад, # |
  Проголосовать: нравится +11 Проголосовать: не нравится

can we get a kotlin remix of this to listen to in contest? https://www.youtube.com/watch?v=WMiELYCfyJA

»
3 года назад, # |
  Проголосовать: нравится -18 Проголосовать: не нравится

Interesting Round.

Surprised with no graph problem (from A to G). Seems like writing graph template went to waste :P

»
3 года назад, # |
  Проголосовать: нравится +15 Проголосовать: не нравится

Fun experience, first round in Kotlin, feels fresh to use

»
3 года назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

Today I learnt to check whether I copied a template with val when I supposed to use var

»
3 года назад, # |
  Проголосовать: нравится -22 Проголосовать: не нравится

Tried Kotlin first time my clean solution to C.

Spoiler
»
3 года назад, # |
  Проголосовать: нравится +10 Проголосовать: не нравится

Codeforces these days be like:

»
3 года назад, # |
  Проголосовать: нравится +30 Проголосовать: не нравится

When will the Random T-shirt winners will be announce?

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится +39 Проголосовать: не нравится

    I recently saw an interesting blog which I think you might want to take a look at. In particular, the second link in the blog will probably be of interest. What are your thoughts on it?

    • »
      »
      »
      3 года назад, # ^ |
      Rev. 2   Проголосовать: нравится +19 Проголосовать: не нравится

      I guess it would be cool to detect plagiarism in this round as it's detected in regular rounds

      • »
        »
        »
        »
        3 года назад, # ^ |
        Rev. 2   Проголосовать: нравится +4 Проголосовать: не нравится

        All these accounts that are in these blog are created a few hours before the contest. It would be cool if jetbrains implies a new rule that you must have to participate at least one rated contest before to be eligible for the prize. Sad thing is these people are participating the contest just because of a t-shirt not for learning a new language.

»
3 года назад, # |
  Проголосовать: нравится +51 Проголосовать: не нравится

T-shirt winners????

»
3 года назад, # |
  Проголосовать: нравится +65 Проголосовать: не нравится

please give updates about random tshirt winners

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

When will the T-shirts winners be announced? It has been more than two days since the contest ended!

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится +40 Проголосовать: не нравится

    I think we should be patient.

    Last time the winners list was announced one week after the contest.

    We all should consider the amount of work that Mike and CodeForces staff are making to operate the website. Angry comments don't show such gratitude and may demotivate them.

    We will eventually know the winners. A few days delay is not a big deal anyway because the prizes take much longer to be received.

    • »
      »
      »
      3 года назад, # ^ |
        Проголосовать: нравится +18 Проголосовать: не нравится

      That could be avoided by announcing approximate date of raffle. But I agree that asking the same question over and over again will change nothing.

»
3 года назад, # |
  Проголосовать: нравится +48 Проголосовать: не нравится

When? ;-;

»
3 года назад, # |
  Проголосовать: нравится +27 Проголосовать: не нравится

Are the winners list out or any information on when it'll be out?

»
5 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

thanks for pushing me to learn kotlin