Блог пользователя cry

Автор cry, 3 года назад, По-английски

Hello Codeforcers!

I am pleased to invite y'all to participate in Codeforces Round 887 (Div. 1) and Codeforces Round 887 (Div. 2), which will start on Jul/23/2023 17:35 (Moscow time). In both divisions, you will be given $$$6$$$ problems and $$$2.5$$$ hours to solve them. The Div. $$$2 $$$ round will be rated for participants with rating below $$$1900$$$, while the Div. $$$1$$$ round will be rated for participants with ratings which are at least $$$1900$$$.

This round was authored and prepared by Benq, emorgan, omeganot, US3RN4M3, me (cry), fast-fourier-transfem, nsqrtlog, buffering, ntarsis30, and ArielShehter.

We want to thank the following people for their contributions:

UPD 1: Score Distribution

Div. $$$2$$$: $$$500 - 1000 - 1500 - 2000 - 2500 - 3500$$$

Div. $$$1$$$: $$$500 - 750 - 1250 - 2000 - 2250 - 3000$$$

UPD 2: Editorial has been posted here

UPD 3: Congratulations to the winners!

Div.1

  1. jiangly

  2. Rebelz

  3. Radewoosh

  4. tourist

  5. EvenImage

Div. 2

  1. dmaksym1177

  2. Tmath_OneLove

  3. onufryw

  4. i_nevergive_up

  5. clonegrandmaster

Good luck! Red panda wishes you all rating inflation!

Art credit to xiaossr

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

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

As a problemsetter, I can certify that I did not test in any shape or form

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

    Hello, are you interested in my approach to question c in div2? I feel that the solution to this problem is not quite the same.https://codeforces.me/contest/1853/submission/215254923

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

would be funny if tourist regains no 1 in a Benq round

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

As a tester, I can confirm that this is a great contest and has great problems, much like another amazing contest by the name of CerealCodes :D

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

As a problemsetter, I hope you all enjoy the problems (especially mine).

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

As a tester, I have enjoyed the round and I hope you also enjoy it.

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

As a tester, I can confirm that this contest is truly one of the contests of all time

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

it has been scientifically proven that if you play genshin impact you will gain rating on this round!!!

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

Time to enjoy -167 delta in a div.1 round!

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

"The Div. 2 round will be rated for participants with rating below 1900 , while the Div. 1 round will be rated for participants with ratings which are at least 1900"

Does this mean that I, as a purple, am forced to participate in Div1 round?

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

Scared for my first div1 round. Hopefully I can actually solve 2 problems and avoid instant demotion to blue.

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

As a tester, I hope u enjoy the round as much as I did

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

I'm afraid to participate cz of your handle.

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

Hoping to become purple. ( Please make this my most memorable contest ever! )

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

Problems are high quality. Definitely try to participate!

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

As a tester I can confirm that this round is just as good as Oshi no Ko chapter 123.

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

As a problemsetter, I can confirm at least one of the problems will feature Ninomae Ina'nis from hololive-EN Myth!

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

As a tester, I can confirm the problems will be problems.

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

i hope to be blue this time

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

Very rare to see this many colors in the author list

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

Hoping for a good div2 round.

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

as a problemsetter who didnt problemset, i can assure you that this will be a great contest :D

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

OMG!! Benq is the writer. Sounds Good!

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится -34 Проголосовать: не нравится

As the president of CerealCodes and a contest organizer, I can assure you that the problems are of high quality (just like CerealCodes problems).

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

As a participant i recommend you to participate.

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

Why didn't PurpleCrayon test when Purple Cry is an author?

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

As a tester, I can confirm that this round will not only give you lots of rating but ginormous muscles too :D

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

Is div.2 also 2.5 hours?

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

Am I the only one who noticed this announcement was made 7 weeks ago?

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

Hi everyone,

We would also like to mention this round was mostly made possible by problemsetters from the CerealCodes initiative!

What is CerealCodes?
»
3 года назад, скрыть # |
 
Проголосовать: нравится +52 Проголосовать: не нравится

As a tester, I can confirm that problemsetting might have happened.

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

As a pupil,hope to become newbie.

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

Benq!This round would be very interesting

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

hope I can be a candidate master.

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

as a cyan participant, i hope to be blue after this contest

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

Excited to see tourist in round prepared by Benq

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

I hope everyone can have a good participation experience

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

Do you mean that you will make us cry in this contest :(

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

will be fun to see if tourist takes back rank 1 in a Benq round

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

The panda looks like Firefox)

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

As a participant I hope I'll get over this damn pain this round T_T

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

Hope for color change!

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

Are you saying Div1 has easier problems?

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

    Based on the score distribution? No, Div1A is the same problem as Div2C, Div1B is the same problem as Div2D etc., the problems are harder. These problems just give less score in Div.1 because the scoring is relative to other problems and usually scoring is started from $$$500$$$ points.

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

Hello Benq. This is a fellow United States of America Computing Olympaid competitor, and wishes for you to not write any problems in the USACO 2023 December Gold contest. If this is possible, I will certainly be elated. Please consider others emotions before problem setting for the USACO 2023 December Gold contest.

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

Hoping to become a green , also good luck for everyone

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

I LOVE YOU CRY :) MY BEST FRIEND, THANK YOU FOR PREPARING A CONTEST <3, good luck to all!!!!.

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

you fool me, i fool you! Good luck

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

Red panda is so cute!

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

It's even a little insulting — authors have all possible colours except green...

Anyway, why there is such a variety — is it some university project or so on?

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

i hope to be blue this time

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

Feeling excited to give this contest.

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

good luck for all

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

I have a question, why the problems of Div.2 have higher score than the problems of Div.1?

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится -6 Проголосовать: не нравится

QaQ

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

Whoever came up with div2 problems B and C I hope that for the rest of their life they would only get pairs of integers as their birthday presents.

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

    That joke was amazing. Div 2 B was did feel kind of out of place for a Div 2 B though. But the C was a really good problem for its position. But its a common and really frequently used fact that certain sequences grow really fast, at some point youll have to get used to it.

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

Imagine 1434ing us

1434 stands for
»
3 года назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

to my cyan color, i will miss you

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

C>>>>>>>A,B

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

Disgusting problem b and c

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

Nightmarish for me..atleast

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

very strange and hardest contest I have never seen ever...

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

Don't know what this round's authors were thinking, but I feel like there is a huge gap between A and B. As a div 2 participant I feel like this round would have been a nice round if B would have been C and C would have been D.

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

ty guys for the another speedforces round

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

div2 c>>b and b>>a. Doesn't feel like this is a well balanced contest :(

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

    Both Div 2 B and C, you had to spot very commonly used ideas. It was your fault you dont have the experience. As a wise man once said, "go solve some problems and learn to use binary search'

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

does the problem ratings depend only on the ratings of the people who solved it or it also depend on the position of problem ??

like consider same problem in div2C and div4H, then comparitivley div2C will have higher solves than div4H

so, if only the ratings of the problem solvers is considered then div4H will have higher rating than div2C.

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

As a div1 contestant, i gave up A after reading it :(

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

Yes, We are cry ing :(

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

thank you codeforces for realising me that cp is not for me

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

More then a half div1 contestants gave up after reading Div2C. Sounds like something that shouldn't happen... Hardest div2C... Spent an hour, but still have as few ideas as after i read it for the first time...

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

Just want a honest opinion , Really 7000 plus people were able to solve B , got me into thinking , for a hard time

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

    Yes. It was very easy, If you would have solved around 40 1500 math rated problems. Because in these types of problems generally we fix something. For example --- To build the whole sequence we just need starting A and B right!!!.

    So just bruteforce all the values of A and B.

    There are bunch of problems in 1400-1500 rating.

    The idea is very very well known.

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

My approach for getting strong idea for C:

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

I failed to impress Ntarsis moreover i failed to impress myself.

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

How to solve div1C?

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

Wow I like Constructive and MathForces so much!!!

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

IMHO Problem B to me was like you either know it or you don't. Like, I can't get a piece of paper and start working on it and finally get an answer, but 7000+ people solving it really got me questioning my existence.

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

First time solving d1ABC!

great problems d1C&D!

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится -10 Проголосовать: не нравится

mathforces

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

I think this contest is not for div 2 coders

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

hardest Div2C I've ever seen

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

Don't make contests just to Show-off.

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

Is there anyone who can give some hint on 1C? I have absolutely no idea.

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

    In this problem, you want to cover an array with intervals such that the $$$i$$$-th octopus is covered by $$$a_i \pmod k$$$ intervals (if $$$a_i = k$$$, set it to $$$0$$$). The idea is that you want to process the array from left to right while opening or closing intervals. Opening an interval has a cost of $$$1$$$ while closing an interval is free.

    Hint 1
    Hint 2
    Spoiler
»
3 года назад, скрыть # |
 
Проголосовать: нравится +14 Проголосовать: не нравится

wow. It was really ( i mean really ) interesting contest ( for me, as div2 user). Amazing second & third problems, like, for me, they was hard, but really interesting. Second was on idea mostly ( like not many fibonacchi numbers ) & third was on idea & realization ( as for me i mean )

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

cry (The author of this blog) really made me cry during the contest.

S/He literally gave the spoiler of the full contest in the handle.

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

Div.2(x) Div.1.2(√)

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

Problem B can be easily solved thanks to this post.

So we can iterate over all values of $$$f_1$$$ from $$$0$$$ to $$$n$$$ and check if there exists integer $$$f_2$$$ such that $$$f_2 \gt = f_1$$$ since we need a non decreasing sequence.

We don't even need to check for $$$k \gt 30 $$$, as $$$f_{30} \gt 2 * 10^{5}$$$ . So the answer for all such values of $$$k$$$ will be 0.

Time complexity : $$$O(n)$$$

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

Div2C was so difficult but once you solve it ,it seems easy.

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

Please somebody tell me how to do div2 C and how you came to this conclusion :(

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

Very unbalanced contest C was very annoying

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

For Div2 B, I got that we want number of integers in the interval $$$[nx_{k-1},nx_k]$$$ where

$$$x_k := \frac{f_{k}}{f_{k+1}}$$$

Here $f_i$ is $$$i$$$-th fibonacci number with $$$f_1 = 0, f_2 = 1$$$. It can be shown that

$$$x_n = \frac{1}{1+x_{n-1}}$$$

with $x_1 = 0$.But when I tried to evaluate this, I was getting TLE on pretest 5; is the way to go?

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

While I'm waiting for solution, here is what I wrote in $$$B$$$ and just now noticed, that this is incorrect.

Corner cases: all are $$$0$$$, all are $$$n$$$, there are $$$0$$$ and $$$n$$$.

For simplicity, there is $$$0$$$. It not, do $$$a_i = n - a_i$$$.

Some number are positive, others are negative. Sort all values. Some suffix is positive and has all edges. Let size of suffix be $$$cnt$$$, sum on suffix be $$$s2$$$ and sum on prefix $$$s1$$$. If $$$s2 - s1 = cnt^2$$$, this is correct split position, answer is $$$YES$$$. Now to build it. Look at suffix, let it be $$$a_1, \dots, a_k$$$. Subtract from all of them $$$cnt$$$. Let $$$idx = 1$$$. Take $$$a$$$ values by blocks of same values. For each block put $$$-idx$$$ to front of result vector $$$a_i$$$ times, then put $$$idx+1$$$ to back of result vector size of block times, add $$$idx += 2$$$. At the end append left $$$-n$$$ to front of result vector.

Further steps:

  1. Write stress

  2. See, as it immedeately asserts, investigate test

  3. Cry, write this

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

    About problem $$$A$$$. Well, that looked obvious for me, that I have just to $$$k - 1$$$ times do $$$x = a_x$$$, where $$$a_x$$$ is a vector of non-mentioned numbers.

    Though, I think that $$$a_i \le 10^9$$$ does not make sense, and makes implementation move complex without any reasons (I wrote something like scanline, also thought about set::lower_bound, of binary search).

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

div 2 c Is a good problem to think about for 3 days after contest

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

Problem B and C were good, amazing contest!!!.

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

This was hard. Managed to lose only 21 (according to carrot), i'll get purple in the next context.

Also my brain farted a little on B when i tried using diophantine equations or double for to find the coefficients. Anyways the problems are nice, B is a very cool property of fibonacci-like sequences

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

2*Div 1

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

I got some inspiration from this task to solve D1A/D2C

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

GoodBye my chance to become master :( I really have hard time

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

Hardforces for div2

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

Nice problems!

Solution for B (if anyone needs):

-> Form the Fibonacci Series up to 200005, call it arr

-> For a Fibonacci Series of length k and last term n, it looks like this:

a, b, b + a, 2b + a, 3b + 2a, 5b + 3a, ....., arr[k — 1] b + arr[k — 2] a

-> The equation is arr[k — 1] * b + arr[k — 2] * a = n

-> Fix the values of a from 0 to n and find if there exists an integral solution b for the equation

-> if exists, ans++

-> One edge case: n is only up to 200000, so k can't be > 200000, if so answer is 0

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

:

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

When every problem in the contest seems solvable but you're still not able to solve all :(

»
3 года назад, скрыть # |
Rev. 5  
Проголосовать: нравится +9 Проголосовать: не нравится

I overkilled problem B by doing fast general fibonacci calculation to determine the last element of the sequence in log(k) time by doing fast squaring of matrices for the fibonacci sequence.

Then I bruteforced over all of the first element, binary searching for the second element using my fast_fibo function to see which one is closest to n. If the fast_fibo(i, j, k) == n, then i increase the count

Time complexity: O(n log(n) log(k)) ??? LOL

I was like: "Theres no way this can be a problem B..."

EDIT: Just failed system tests LOL

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

I came up with a pretty easy and intuitive solution for div2 B after about an hour.

Div2 B
  • »
    »
    3 года назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится

    can you please tell(maybe briefly) about the intuition...

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

      I have just simulated the whole process according to the question. For a given number $$$N$$$ at $$$k$$$ th position, I am brutally checking if it is possible to have some number $$$x$$$ $$$(0 \lt = x \lt = N)$$$ at $$$(k - 1)th$$$ position.

      Check function is really simple, if we just fix $$$(k - 1)th$$$ number and $$$k$$$ th number in a fibo sequence, we can easily determine that $$$(k - 2)th$$$ number will be the difference of $$$k$$$ th number and $$$(k - 1)th$$$ number. With that we can easily determine if the sequence we are getting by fixing those $$$2$$$ numbers is a valid sequence or not by recursively calling the same function with different values of $$$N$$$ and $$$K$$$. Sequence is Valid if $$$k = 0$$$ and $$$N \gt = 0$$$ otherwise if $$$N$$$ become negative, the assumed fibo sequence is inValid.

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

The problems are so hard that very few people are able to solve CDEF in div.2

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

B felt a little tougher than a usual div2 B, A was perfect

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

Performed really badly! Don't even feel to give cf contests anymore!

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

For Div2 B I tried hacking with this solution 215216845 with test case: 1 200000 1000000000 but judge gave me unsuccessful hacking verdict. Can anyone explain why the above mentioned solution won't TLE on this test case. Also the solution got FST on test 21 with TLE verdict.

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

Solved B with just brute force, just like what the problem said: Solution

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

for problem b, the constraints are tricky because the highest Fibonacci term (where in the original Fibonacci sequence the first two terms are min possible ) less than 2 * 10 ^ 5 is the 27th term(0-based) so it's okay to brute force the solution. you know that the last element is n so start from pos n — 1 and try all numbers that you can use from n to 0 and call it x for every x use recursion to build the sequence, if at any pos you can't get a valid value ( positive and less than the next value in sequence ) so this x is invalid

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

very nice problems

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

div1 A is so hard,but div1 B is too easy.There's also a huge gap between problem B and C.

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

Nice finally some quality stuff!

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

Just realized after the contest that B could be solved by brute force bcoz Fibonacci series is exponential , great contest overall!

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

Binary search is really a great thing

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

Congrats to all the top-participants!

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

I used a mysterious method to pass this problem in C of Div2, with time complexity O(n). Is anyone interested in proving the right thing to do? https://codeforces.me/contest/1853/submission/215254923

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

I solved Problem C with binary search. I search if we can delete a prefix of numbers 1, 2, 3, ... x using given operations. If we can delete it then we can also delete prefix upto x-1, x-2 and so on.

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

I have a Question about a problem, in problem D in Div 2, or problem B in Div 1, I sent my code which was graded as a RTE in case 18, I simply changed the variables from long long to int, and magically the problem was an AC. The more I try to explain why this happened, the more confused I am, mostly because I only use 4 arrays of size 2x10^5 and a few extra variables.

I'm sending my submission that got an RTE: RTE code

And my submission that got the AC: AC code

I would thank so much to whoever explains me why this occurred.

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

Why 256MB ML?

Sometimes people ask this question and the answer is often like "Hmm, we didn't intend to accept or reject your solution. We just didn't recognize such a solution, and used the default ML". Today I got MLE in Div1D and I guess this is yet another example of the above story.

This is certainly my mistake, and I won't complain about it to the authors. However, I'd like to ask why is the default ML 256MB, and I'd be happier if it was 1024MB or something. Is there a particular reason for the current value, or it's just that nobody cares?

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

    hi, i prepared div 1d, and indeed there were a lot of things i could do better, i apologize :(

    It is like you said, we did not consider raising the ML since all testers' solutions had very little trouble passing under the constraints; all of the solutions that AC pass with minimal memory.

    Next time I will try to be more careful, once again, sorry :(. But I do think you raise a good point. A lot of the times blatant MLE can be caught by TLE anyways, and unless the problem is about optimizing memory (which usually isnt fun) there is little point in blocking slightly worse solutions with a valid memory and time complexity. I will try to keep this in mind for the future.

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

Ratings updated preliminary, it will be recalculated after removing the cheaters.

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

Happy for becoming pupil :)

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

disappointed , couldn't solve C

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

should've swapped c and d in div2

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

215249497 Hmm, I have O(n) solution for problem D. Can somebody give me a counter test?

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

B was actually pretty hard 4 a normal div2 B.

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

https://youtu.be/9fNJvvqVTpo

The problems B,C and D of div2 was very good learnt a lot, not able to perform well during contest.

try to explain solutions of Problem A,B, C and D in this video

problem A: try to unsort a[i] and a[i+1] for each i.

problem B: try to reach Ax+By=N; where A is kth no of fibonacci series {f[0]=1,f[1]=0}; where B is kth no of fibonacci seires {f[0]=0, f[1]=1}; and find out the no of integer solution of x and y such that x is less then or equal to y;

problem C:- what is the position of x after first day? and then in how many days x will be removed;

problem D:for every i and j (abs(bi)!=abs(bj)) and try to find out number of positive intergers in imbalanced array, and then fill positive intergers one by one and according to need fill negative integers.

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

I solve Div2 C differently. After some day it falls into a pattern. So our task is to find when it falls upon a pattern. Take a look at my code 215241713

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

can anyone explain the solution of div2 c question?

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

Rating of Problem D ?