flaviu2001's blog

By flaviu2001, history, 4 years ago, In English

This is a problem that has baffled me for years. I kept thinking and the cases where n<=4 are simple enough but I can't figure a general pattern. So to explain the title a little take n=4 and arrange the n points in a square shape. So perhaps the points are (0,0) (1,0) (0,1) and (1,1). The largest segment is (1,1) — (0,0) and is length sqrt(2). The smallest segment is (0,0) — (1,0) and is length 1. So the ratio is sqrt(2)/1 = sqrt(2) and I am pretty sure this is the smallest ratio you can get for n=4. For n=3 you can arrange the points into an equilateral triangle for a ratio of 1, all the segments are the same length and for n=2 the ratio is also 1. I'm sure it's not as simple as placing the numbers into a regular polygon shape every time as placing one of the points inside the polygon will make more room between points keeping the longest distance relatively constant.

So if anyone has any sort of insight or even a solution for n=5 or n=6 I'd be very thankful!

Full text and comments »

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

By flaviu2001, history, 4 years ago, In English

Hi Codeforces!

stefdasca, koala_bear00 and I are very excited to announce our first contest Codeforces Round #676, which will take place Oct/18/2020 12:05 (Moscow time). The round will be rated for participants with rating up to 2099.

The tasks were written by me with help from stefdasca and koala_bear00 and you have to help some of the authors' favorite musical artists to solve the problems they're faced with.

We hope we compiled a very interesting contest with memorable tasks :)

Special thanks to:

You will be given 2 hours to solve 5 problems, good luck everyone and have fun!

UPD 1: After the round you can watch videos explaining the solutions to the tasks on stefdasca's Youtube channel.

UPD 2: The round was rescheduled, because of intersection with other scheduled contests.

UPD 3: The scoring distribution is standard 5001000150020002500.

UPD 4: The editorial was posted and you can check stefdasca's video solutions aswell.

UPD 5: The round is finished, we are glad everything went smooth and hope you enjoyed our tasks!

Div1 winners (unofficial):

  1. I_love_Tanya_Romanova
  2. LJC00118
  3. 244mhq
  4. LayCurse
  5. uwi

Div2 winners:

  1. RGB_ICPC2
  2. _ztyqwq
  3. AnakMbah1937
  4. SakuraiMomoka
  5. asdsasd

Congratulations to those above and to everyone for participating!

Full text and comments »

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

By flaviu2001, history, 4 years ago, In English

1421A — XORwice

Idea and solution: flaviu2001

Hint
Solution

1421B — Putting Bricks in the Wall

Idea: flaviu2001, solution: flaviu2001 and stefdasca

Hint
Solution

1421C — Palindromifier

Idea and solution: flaviu2001

Hint
Solution

1421D — Hexagons

Idea: flaviu2001, solution: flaviu2001 and koala_bear00

Hint
Solution

1421E — Swedish Heroes

Idea and solution: flaviu2001

Hint
Sneaky corner case
Solution
Proof for the pattern

You can also see the video solutions on stefdasca's Youtube channel

Full text and comments »

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

By flaviu2001, history, 6 years ago, In English

Statement

  The following problem was given at a Romanian national contest in 2016, I've solved it quite a long time ago but only now have i got around to showing it to you. You are given a positive natural number S <= 10^5 and you are required to print the number of non-decreasing sequences with sum S or less modulo 666013. For example if S = 4 the answer is 11 (the sequences are {1}, {1, 1} ,{1, 1, 1}, {1, 1, 1, 1}, {1, 1, 2}, {1, 2}, {1, 3}, {2}, {2, 2}, {3}, {4}). You've also got 1 second and only 8MB of memory. The solution has 3 parts so if you want to try it yourself you may read one paragraph at a time for hints.

Full text and comments »

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

By flaviu2001, history, 6 years ago, In English

I recently came across a beautiful problem from the Romanian national olympiad from 2005. It has a beautiful intended solution but i will provide another you might have tried if you couldn't find it.

A sequence is called circular if its elements consist of only 'A' and 'B', it has size n (n >= 1) and the element next to the last is considered to be the first. A consequence of such a sequence is that there are precisely n contiguous subsequences (from now on whenever we mention subsequence we mean a contigous one) of any size, for example for "ABBA" the 4 subsequences of size 3 are in order "ABB", "BBA", "BAA", "AAB".

A sequence is called special if it satisfies the property of the circular sequence defined above and furthermore ANY two subsequences of equal size differ in the number of characters 'A' by at most 1. For example "AABB" is not special because there exist "AA" and "BB", "ABABAABAAB" is not special either because of "AABAA" and "BABAB", but "ABA" and "AABABAAB" satisfy the property.

Your task is given a circular sequence to determine whether it satisfies the special property. Consider as examples the 4 sequences given above.

Full text and comments »

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