By NercNews, history, 7 years ago, In English

text

Let us introduce the new programming language in ICPC: Kotlin. It is modern and developing language created by our sponsor JetBrains. Kotlin is inspired by Java and as Java is named after the island. Currently, Kotlin programs are compiled into JVM bytecode, all Java written code can be used from Kotlin sources and Kotlin written code can be used from Java sources as well out of the box. Kotlin being developed now most of the standard libraries are Java library classes, making Kotlin a programing language that is already used in many projects being the main language of their development.

Comparing to Java language some Java disadvantages fixed and new features added. Some of them we will see in today's solution of ICPC World Finals 2016 problem C (101242C - Ceiling Function). Less boilerplate code and syntactic sugar added

  1. new operator omitted
  2. data classes implement hashCode, equals and toString methods depending on constructor parameters
  3. operator overloading
  4. with function, to implement a block of code, making captured value as this
  5. when operator providing better readability of conditional operator in some cases
  6. type inference (IDE supports hints on variable and function types, it's just you don't have to type it)
  7. functional programming style
import java.util.*

data class Tree(var left: Tree? = null, var right: Tree? = null) {
    var value = 0
}

operator fun Tree?.plus(x: Int): Tree? {
    if (this == null) return Tree().apply { value = x }
    if (x < value) {
        left += x
    } else {
        right += x
    }
    return this
}

fun main(args: Array<String>) = with(Scanner(System.`in`)) {
    val n = nextInt()
    val k = nextInt()
    val a = Array(n) { IntArray(k) { nextInt() } }
    println(a.map { it.fold(null, Tree?::plus) }.toSet().size)
}

You can try Kotlin at: https://try.kotlinlang.org

Full text and comments »

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

By ODT, history, 7 years ago, In English

Hello, Codeforces!

We are glad to invite you to participate in Codeforces Round #449 (both Div. 1 and Div. 2) which will be held on December 2, 17:05 MSK.

There are seven problems, created by webmaster, ODT, dogther.

This round is about the happiest girl in the world — Chtholly Nota Seniorious~!

You will help Chtholly, Nephren, Ithea and Willem (characters in the great novel and anime "What Do You Do at the End of the World? Are You Busy? Will You Save Us?") to solve some problems.

(Image by gin_sei56(・.8・) on pixiv)

This round is our first round on Codeforces.

Thanks to zcyskyaa for helping us, Arpa, cyand1317 and Tommyr7 for testing the round, vintage_Vlad_Makeev and KAN for round coordination and MikeMirzayanov for Codeforces and Polygon platforms.

This round has 5 problems in each division and you have 2 hours to solve them.

The scoring will be announced shortly before the start of the contest.

The contest is rated for both Div. 1 and Div. 2 contestants.

It's recommended for both divisions to read through the Interactive Problems Guide before the round.

Wish everyone high rating and accepted submissions!

Upd: Scoring is 500-1000-1500-2000-2500

Upd2: Congratulations to the winners:

Div 1:

  1. MrDindows

  2. bmerry

  3. krismaz

  4. Shik

  5. ainta

Div 2:

  1. blatuitorulmlc

  2. lumibons

  3. Starlit

  4. Grevozin

  5. lyoz

The editorial will be posted soon.

Upd3: Editorial

Full text and comments »

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

By NBAH, history, 7 years ago, translation, In English

Hi everyone!

Codeforces Round #448 (Div.2) takes place on 26th of November at 19:05 MSK. As usual, Div.1 participants can join out of competition.

This is my second round on Codeforces! I advise you to read all of the 5 problems. Hope everyone will find something interesting.

I'd like to thank vintage_Vlad_Makeev for coordination, igdor99 for helping me in developing problems. And, surely, thanks to Tommyr7, Arpa, 300iq for testing this round.

Of course, many thanks to MikeMirzayanov for great Codeforces and Polygon platforms.

Scoring: 500-1000-1750-2000-2250

High ratings to everybody!

UPD: Contest is finished. Editorial will be posted soon.

UPD: Editorial

Congratulations to the winners!!!

Div1

  1. uwi

  2. Benq

  3. irkstepanov

  4. dreamoon_love_AA

  5. JustasK

  6. eddy1021

  7. yancouto

  8. chemthan

  9. Nephren_Ruq_Insania

  10. KrK

Div2

  1. Nephren_Ruq_Insania

  2. Mahan_sh

  3. lsrothy

  4. ngfam

  5. georgerapeanu

  6. ZalBinHassan

  7. mtkaya

  8. Bodo

  9. szhouan

  10. fchirica

Full text and comments »

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

By Huawei_Codecraft, 7 years ago, In English

If you are 14+ and want your ideas to be implemented in new technologies and products, which being used by 1/3 of global population, participate in our Marathon started recently https://it-edu.mipt.ru/en/huawei-codecraft-marathon

Task can be downloaded after registration, see links below: John has a digital camera. He usually takes two photos, first photo is bad quality and blurred, second has good quality, but his hands shaked, and the second photo has moved compared to the first one. Help John to restore first(blurred) photo position, considering that the movement was in the same plane.

Solution: We highly encourage participants to use neural network based approaches for solving this task. You can download 30 samples from checker in txt format. Data generation for neural network training is one of the main point in our task. Converter from/to graphic format is also part of this task.

Registration can be done by captain. The team can consist from 1 to 3 team members: https://it-edu.mipt.ru/el/mod/apply/view.php?id=60 Checker http://huawei.it-edu.mipt.ru/marathon1 Rules https://it-edu.mipt.ru/en/huawei-codecraft-marathon/rules

Submission deadline is 2017 December 1, 23:59:59 Moscow time. Results will be announced on December 3 during the closing ceremony of 1/2 NEERC ACM ICPC 2017 at ITMO.

@stake are 9 internship certificates, 9 smartphones, several tours to HQ

Full text and comments »

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

By BledDest, history, 7 years ago, translation, In English

Hello Codeforces!

On November 23, 18:05 MSK Educational Codeforces Round 33 will start.

Series of Educational Rounds continue being held as Harbour.Space University initiative! You can read the details about the cooperation between Harbour.Space University and Codeforces in the blog post.

As an experiment, the round will be rated for Div. 2. It will be held on extented ACM ICPC rules. After the end of the contest you will have one day to hack any solution you want. You will have access to copy any solution and test it locally.

You will be given 6 problems and 2 hours to solve them.

The problems were prepared by Mikhail awoo Piklyaev, Vladimir vovuh Petrov and me.

Good luck to all participants!

UPD: Editorial.

I also have a message from our partners, Harbour.Space University:

Be sure to join these courses to sharpen your programming and data analysis skills:

Combinatorics and graphs with Sergey Nikolenko, Researcher, Steklov Mathematical Institute at. St. Petersburg. He is a computer scientist with vast experience in machine learning and data analysis, algorithms design and analysis, theoretical computer science, and algebra.

Algorithms and Data Structures with Edith Elkind, Professor University of Oxford, Department of Computer Science. She researches game theory and the computation of social choices. She looks at the decisions involved in multi-agent systems such as auctions, elections and co-operative games.

Big Data Analysis: Mapreduce, Spark, BigTable/HBase, Distributed Data with Pavel Klemenkov and Alexey Dral. With HDFS, MapReduce, Spark, and NoSQL, students will master and sharpen their knowledge in basic technologies of the modern Big Data landscape.

Parallel and Distributed + High Performance Computing with Dalvan Griebler. The name says it all. Learn how to run your programs faster.

List of all courses:

27.11.17 — 15.12.17 — Image and Video Analysis with Archontis Giannakidis

27.11.17 — 15.12.17 — Linear Algebra with Archontis Giannakidis

08.01.18 — 26.01.18 — Text Mining & Translation with Sergey Nikolenko

08.01.18 — 26.01.18 — Combinatorics and graphs with Sergey Nikolenko

29.01.18 — 16.02.18 — Security analysis of networked objects with Yaroslav Rabovolyuk

19.02.18 — 09.03.18 — Security Operations Center and Cyber Threat Hunting with Sergey Soldatov and Teymur Kheirkhabarov

19.02.18 — 09.03.18 — Calculus with Dmitry Ivankov

12.03.18 — 30.03.18 — Malware Reverse Engineering with Vladislav Stolyarov, Victor Chebyshev and Boris Larin

09.04.18 — 27.04.18 — Incident Response & Digital Forensics with Konstantin Sapronov and Ayman Shaaban

09.04.18 — 27.04.18 — Linear algebra with David Zmiaikou

30.04.18 — 18.05.18 — Statistical Data Analysis with Evgeniy Riabenko

30.04.18 — 18.05.18 — Probability theory with Evgeniy Riabenko

21.05.18 — 08.06.18 — Parallel and Distributed + High Performance Computing with Dalvan Griebler

21.05.18 — 08.06.18 — Algorithms and Data Structures with Edith Elkind

11.06.18 — 29.06.18 — Big Data Analysis: Map Reduce, Spark, BigTable/HBase, Distributed Data with Pavel Klemenkov and Alexey Dral

Register for your spot

Full text and comments »

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

By gKseni, 7 years ago, translation, In English

Innopolis University is organizing and holding Innopolis Open, an Olympiad in Informatics for high school students under 19 years old. The Olympiad consists of two stages — the online contest and the on-site competition (held in Innopolis, Russia).

Winners of the first stage will be invited to Innopolis to take part in the on-site competition. Accommodation, meals and transfer from Kazan to Innopolis are covered by the organizing committee. Winners of the second (on-site) stage will receive awards and opportunity to be enrolled in Innopolis University without any admission tests.

The first stage (online contest) will be held on:

  • December 2, 15:00 (UTC +3)
  • December 17, 10:00 (UTC +3)
    You may participate on both dates; the organizing committee will consider your best result. Registration is open until December 1, 2017. Participation is free of charge. The second stage (on-site contest) will take place in Innopolis city on February 24-25, 2018.

Click here to find out more and register for the Olympiad.

Stay in touch:

Full text and comments »

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

By MikeMirzayanov, 7 years ago, translation, In English

Hello!

I am pleased to report that two rounds of Codeforces have gone quite well in terms of the work of Codeforces, I am very glad about it. These days nights I spent in a profiler, fixing the code, researching the settings of MariaDB.

In addition, I managed to allocate several hours on Sunday (to be honest, until Monday morning) to finish the long-planned innovation.

Meet, diagnostics of solutions in C++!

Many Codeforces visitors are already tired of the questions of less experienced participants: "Why does my solution not work on some test on the Codeforces servers, if I locally launch it and it works correctly? You have the wrong compiler/servers!" In 99% of cases this is an example of undefined behavior in a program. In other words, the program contains mistakes that, due to a number of circumstances, are not reproduced at local launch, but are reproduced at launch on the Codeforces servers.

Sometimes, it's not easy to notice such a mistake. A small overflow of the array can lead to an incorrect answer on the test and to an runtime error of the program.

In g++/clang++ there is a remarkable tools called sanitizers. It's such a way to compile a program in a special mode so that when it's working, it will check it for undefined behavior (and some other errors) and, if any, print them to stderr. The drmemory (it is similar to valgrind, but for Windows) has similar functionality, which starts the program in a special mode to detect errors. With such two diagnostic launches, the performance of the program suffers tremendously (the program is executed 5-100 times slower and requires more memory), but often it's worth it.

Now automatic diagnostics in some cases will prevent a question like "Why does not work ???", indicating the error or its appearance!

If your solution:

  • written in C++,
  • finishes with a verdict "wrong answer" or "runtime error"
  • on this test worked extremely quickly and consumed a little memory,

then it will be restarted using special diagnostic compilers (clang ++ with sanitizers and g++ with drmemory). If an execution error occurs during this launch, the diagnostics log will be displayed in the test details in the "diagnostics" section. Of course, this entry will contain a technical report in English, but often it will indicate to you the error of the program. Often it contains the cause of the mistake and even the source code line. If the diagnostics are not displayed, then at least one condition above is not fulfilled or the diagnostics has not detected any errors.


Example of the diagnostics:  here it is written that there was an array out of range error in the line 78.

Thus, the diagnostics will sometimes help you to find a mistake like "out of bounds error", "signed numbers overflow", "uninitialized variable", etc. Carefully read the diagnosis and do not make such mistakes in the future!

I wish your programs did not fail. I hope the innovation will be useful!

There are big plans as it is useful to apply such diagnostics. Do not go far, wait for news, soon there will be more innovations!

P.S. Also, diagnostic compilers are simply available for use. For example, you can use them on the "Custom invocation" tab. I recall that the program runs many times slower and consumes more memory in diagnostic mode.

Full text and comments »

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