Yury_Bandarchuk's blog

By Yury_Bandarchuk, 8 years ago, In English

Hello, Codeforces!

I want to invite all of you to participate in HourRank 14.

There will be four problems to solve in ONE hour. I am the author of all the problems in this contest and I hope you will enjoy solving them. Also, I would like to say thanks to danilka.pro and Shafaet for helping with contest preparation.

The top 10 will get awesome HackerRank t-shirts.

Editorials will be available at the end as usual.

Good Luck and Have Fun! :)

Score distribution is the following: 25-40-60-80

UPD: Unfortunately, contest will be unrated! :(

I am sorry for everything bad happened during the contest.

Full text and comments »

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

By Yury_Bandarchuk, history, 8 years ago, In English

Hello CodeForces Community,

I would like to invite you to participate in 101 Hack 41 will be held on Tuesday, 20 of September. The problems were set by me (Yury Bandarchuk) and josdas (Stanislav Naumov), tested by wanbo.

101 Hack is back with its 41st edition! Passionate programmers will enjoy solving algorithmic challenges. It's all about speed, accuracy and efficiency: 5 challenges in 120 minutes. Every second counts!

Top 10 winners on the leaderboard will receive a HackerRank T-Shirt.

Hope, you will participate and enjoy the problems.

Good luck && have fun!

Full text and comments »

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

By Yury_Bandarchuk, 8 years ago, translation, In English

Hello everyone!

Recently, I decided to learn a little bit API and Java. After some time of considering I decided to create an application (CodeforcesSurfer). Using this application you can get any information from Codeforces i.e. user info, contest info and etc.

I started doing it today :D Buuut, nevertheless I have already coded something.

Btw, I want to emphasize that this app (or if it's possible to say — project) is developing for getting knowledge of API, JSon, Java, Java GUI and so on.

Therefore I invite everyone who wants to contribute or if it's interesting for you.

Here is the project.

Will appreciate any comments and advice!

P.S. don't pay too much attention to the design :D

You can download the current version here.

P.P.S Now it looks like this:

Full text and comments »

  • Vote: I like it
  • -2
  • Vote: I do not like it

By Yury_Bandarchuk, history, 9 years ago, translation, In English

Hello everyone!

I am high school senior (will be freshman this fall) now. After some time of considering I decided to find some programming summer camp. Unfortunately, I met some difficulties with finding good camp. I think that maybe someone who is reading this post now knows about such programs in your college or university.

I will appreciate any help!

Thanks in advance!

Full text and comments »

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

By Yury_Bandarchuk, 9 years ago, translation, In English

Hello CodeForces Community,

I would like to invite you to participate in HackerEarth March Easy Round that will be held on Tuesday, 01 of March. The duration of the contest if 3 hours.

The problems were set by me (Yury Bandarchuk) and tested by RomaWhite (Roman Bilyi). The difficulty of this round will be like usual Div. 2 Round or a little bit easier.

As usual all the problems will have partial scoring.

In any case, Good Luck && Have Fun all of you! See you on round!

UPD: Contest is over! Congratulations to winners!

Also, sorry for bugs with problem "Benny and Triangle", but in any case I hope you liked the problems.

Full text and comments »

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

By Yury_Bandarchuk, 9 years ago, In English

Hello CodeForces Community,

I would like to invite you to participate in 101 Hack Feb 2016 will be held on Sunday, 21 of February. The problems were set by me (Yury Bandarchuk) and tested by CherryTree (Siarhei Kulik) and wanbo. Also, I am so grateful to pashka for solving some problems on Java.

101 Hack is back with its 34th edition! Passionate programmers will enjoy solving algorithmic challenges. It's all about speed, accuracy and efficiency: 5 challenges in 120 minutes. Every second counts!

Top 10 winners on the leaderboard will receive a HackerRank T-Shirt.

Hope, you will participate and enjoy the problems.

Good luck && have fun!

UPD: Contest has ended! Congratulations to winners! Editorials for every problem are available now.

  1. riadwaw

  2. I_love_Tanya_Romanova

  3. Errichto

Want to hear your feedback about the problems!

Full text and comments »

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

By Yury_Bandarchuk, 9 years ago, translation, In English

Problem A.

Everything that you needed to do — solve some similar cases.

You need to check the following cases:

  • Home the first shop the second shop home

  • Home the first shop the second shop the first shop home

  • Home the second shop home the first shop home

  • Home the second shop the first shop the second shop home

Time: O(1)

Problem B.

First of all, you should read the statement carefully. Then, for every element 1 ... N create a list of integers from what we can get this number.

After that you have to check some cases, before that create a special mark for answer Ambiguity:

Let current element of the given array is bi

  • If two or more elements exist from which it's possible to get bi, then use your special mark that answer is Ambiguity
  • If no elements exist from which it's possible to get bi, then print Impossible
  • If only one element exists from which it's possible to get bi just change bi to the value of this element

Finally, if you marked your special mark then print Ambiguity, else print Possible and correct answer.

Time: O(N)

Problem C.

Let's take a minute to see how the best answer should look like.

Let Hi be a sorted sequence of hi. Let E — set of indices of the last elements of each block. Then e E, first e sorted elements of sequence hi are equal to the first e elements of the sequence Hj.

So, it is not difficult to notice that the size of E is the answer for the problem.

Firstly, we need to calculate two arrays: prefmax and suffmin, where prefmaxi — maximum between a1, a2, ..., ai, and suffmini — minimum between ai, ai + 1, ..., an.

If you want to get the answer, just calculate the number of indices i that prefmaxi  ≤  suffmini + 1.

Time: O(N)

Problem D.

First of all, let's solve this problem for n ≤ m, and then just swap n and m and print the answer. Important! Not to print squares twice!

We can use this formula for fixed n & m (n ≤ m) for calculating the value of x.

Then

Using the sum squares and the sum of the first k numbers we can easily solve this problem.

Getting 6x = 6n2 * m - 3(n2 + n3 - nm - n2) + 2n3 - 3n3 + n = 3 * m * n2 + 3 * m * n - n3 + n

As we solved this task for n ≤ m the 3n2 * m =  ≈ n3, it means that n is not greater than .

Time:

Problem E.

The solution for this problem is dynamic programming.

Let froot, mask is the number of ways to build a tree with root in vertex root using vertices from the mask mask and all restrictions were met. For convenience we shall number the vertices from zero.

The answer is f0, 2n - 1.

Trivial states are the states where a mask has only one single bit. In such cases froot, mask = 1.

Let's solve this task recursively with memorization. To make the transition, we need to choose some kind of mask newMask, which is necessarily is the submask of mask mask. Then we should try to find new root newRoot in mask newMask. Also, in order not to count the same tree repeatedly impose conditions on the mask newMask. Namely, we shall take only such masks newMask, in which the senior bit (not in charge of the root) coincides with a senior bit (not in charge of the root) of the mask mask. After that, you need to check the fulfillment of all conditions to the edges and to the lca. If everything is OK, update . Where means xor.

What about checking lca, it's possible to do it in time O(N2) — previously memorized lca for each pair or in the worst case in time O(Q) just iterating through all pairs of vertices, for which some vertex v is lca.

Time: O(3N·N3) or O(3N·N·Q)

Full text and comments »

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

By Yury_Bandarchuk, 9 years ago, translation, In English

Hi, Codeforces.

I am happy to say that Codeforces Round #332 (Div.2) will take place November 20th at 19:35 MSK. This is my second Codefocres round and I hope not the last.

Thanks a lot to Dmitry Rozhkov (rui-de) for solving these problems, also thanks to Vlad Vishvevski (Vladik) for cool pictures. I'd like to thank Gleb Evstropov (GlebsHP) for help in round preparation. And, as usual, big thanks to Maria Belova (Delinur) for statement translation and to MikeMirzayanov for such great systems as Codeforces and Polygon.

The duration of the contest is two hours. What about tasks, it's not a secret that you can find Spongebob's pineapple and a restaurant with strange name "Crasti Crabs", cosy beach and Jellyfish Meadows on the bottom of the ocean. Spongebob and his friends need in your help, help them!

I strongly recommend you to read all the problems and, probably, you will find something right for you.

As usual, scoring distribution will be announced later.

UPD: Score distribution — 500 — 1000 — 1500 — 2000 — 3000.

Editorial.

Div. 2 Winners

 jerjerismygf

 rakhashov.maksat

 jeremy624lolz

Div. 1 Winners

 MrDindows

 anta

 ngfam_kongu

Congratulations!

Full text and comments »

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

By Yury_Bandarchuk, 9 years ago, translation, In English

Hi, guys! I need help with task on main.edu.pl in which I should write a library. I try to solve this task. So, How I can solve this task offline. (I want to use parallel binary search, but I don't know how to write such library.

Full text and comments »

  • Vote: I like it
  • -15
  • Vote: I do not like it

By Yury_Bandarchuk, 10 years ago, translation, In English

Hi everyone!

Codeforces Round #267 will take place on September 18th at 19:30 MSK My name is Yura and this is my first Codefocres round and I hope not the last.

I'd like to thank Fedor Korobeinikov (Mediocrity) and Alex Vistyazh (netman) for helping me to test all the tasks and prepare this round. Also, special thanks Gerald for helping me to prepare the tasks, Delinur for translation of all problem statements into English and MikeMirzayanov for Codefocres and Polygon.

I hope that everyone will find the problem for himself, and plunge into the student's life.

Good luck! =)

Full text and comments »

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