Hello Codeforces!

I am pleasured to invite you to take part in Hello 2023, which will take place in Jan/03/2023 17:35 (Moscow time)!

This round consists of $$$8$$$ tasks waiting for you to solve in $$$150$$$ minutes, and will be rated for everyone!

As an author, please allow me to express my sincere thanks to:

- dario2994, for being responsive, his amazing guidance, helping me prepare one of the problems and his truly wonderful coordination!
- KAN, for rechecking and translating the round!
- wxhtzdy, for proposing rejected tasks and discussing every problem with me
- Giove, for a problem idea which fits a gap.
- Um_nik, gamegame, JovanB, Marko, cip999, nweeks, NemanjaSo2005, Sofija06, Fikuss, badlad, Jovan08, for providing valuable feedback and submissions during testing!
- MikeMirzayanov, for great platforms Codeforces and Polygon!

I hope you enjoy our problems and have a wonderful $$$2023$$$!

**UPD1**: New score distribution is $$$500 — 750 — 1250 — 1500 — 2250 — 2250 — 2750 — 4000$$$.

**UPD2**: Editorial is out!

**UPD3**: Congratulations to the winners!

**UPD4**: Also, congratulations to the first solves of each problem!

Happy new year and we hope it will be a happy year for everyone<3

Happy New Year dear friends. May this year be the cause of the best success for all people! I wish you health and happiness!

Thank you and I wish you too

Why so hard

i thought the same, i couldn't even the solve the A one.

why are you telling me (I'm not the author)

They want clout

With new happiness and with a new title!

Hi there, I'm new of codeforces, so to be consistent here I'm starting a 365 days of code streak. And this is also one of my New Year Resolutions. if you are a beginner, you can join also.

Rules:

1) Write a code for at least 1 problem on codeforces. You can start with the problems with minimum difficulty i.e 800. These problems take 5-10 minutes on average. Try solving one now https://codeforces.com/problemset?order=BY_RATING_ASC&tags=800-

2) After solving the problem take the screenshot of your whole activity frame like this and send in the whatsapp group. The reason for using whatsapp is to stay connected with the group daily as most people open whatsapp at least once a day. You can mute the group also. Can be moved to a website later.

3) Don't forget to have fun!

register here: https://forms.gle/X3FJ4Wug33npFmYk6

Why does your sign up form assume everyone has graduated high school? You know there are a ton of high schoolers (and some even younger people) who do competitive programming, don't you?

this post was originally for my LinkedIn circle where mostly were graduates, you can write N/A there.

Oh yeah, makes sense.

Please don't include the number 2023 in the problems. Last contest was somewhat amazing(!)

'Please print the answer multiplied by the number 2023.' never mind...

for goodbye round actually

you are 2023*smarter than anyone here

May be it will be in the last contest of 2023,like it was in the last contest of 2022.

I have a delta of -201 from last 5 contests, don't know how much time it will take to regain these lost points.

Maybe Hello 2023 will be enough, if you get a rank of 500-600.

Best of luck.

Thanks

around the same

Actually it depends on your performance and mentality, I've bad contest consecutively and get something like -250 (because I was just bored from contests, I didn't wanted to solve after B or something like that I was just bored), I became a spec after that while I was stuck on upper expert for months. But I was actually better than that, I earned +479 in 3 contests and became a candidate master finally.

Congo becoming master :)

;)

Happy New Year :)

The same to you :)

Good luck in the first contest in 2023!

As a tester, I quite enjoyed the problem set. I hope that you will enjoy the first round of 2023 and I wish you a great New Year!

Waiting for the time where tester asks for the contribution after the contest or tester criticize the problem set may be the problems those were excluded.

The point of having testers is for them to criticize problems before the round so that round has good problems. Tester who says that problems are good to the coordinator, but changes after the round is a bad tester.

And yes, I (and many other testers) did criticize one problem which was removed from the problem set and is now replaced.

Should not share the details before the round

Harshly true xD

Happy new year! Wish to get positive deltas!

badlad orz

Happy new year 2023 Everyone

Hope I will get +86 rating

Is it for beginner?

I hope I will become a expert in this contest. Good luck all of you.

Wishing Happy New Year and Positive Delta for everyone.

Hoping for +82 and finally achieving Cyan for the first time.

go to magic section and flex on your gf

For that I need a gf

fax

Or you can be like me. Downgrade your colour, show your gf, then put your colour back to the original and she will be even more proud of you.

Spoiler:It worked, miraculously.

Happy new year everyone hope to see a year full of learning and success.

Why are you changing your comment again and again bro

Because I am getting a lot of downvotes and I don't know why.

I mean, tourist isn't exactly undefeated. He has been passed a couple of times, including by Benq.

He always comes back to the top tho

Happy New Year Everyone! Hoping for positive delta in Hello 2023. Upvote for good luck in 2023.

Interesting score distribution!

WOW, Serbian round, guessing some good problems :) Happy New Year for everyone!

It is a good opportunity to start 2023 with good contest

Good luck in the first contest in 2023!

I hope it is not an ad-hoc contest :)

hope it has a graph problem!!

i hope a, b, c, d is not graph, because it is very bad.

I hope I can go above pupil this year :)

Happy New Year

As a tester one day , I hope this round is a good start of 2023 and I wish you a great New Year!

What kind of problems div1 or div2 or div3 or div4? Happy New Year

The round is combined Div 1 and Div 2. That means that problems A-F will be like div 2 A-F and problems C-H will be like div 1 A-F.

thanks :) happy new yearrr

Happy New Year :D

Happy New Year!

Hope to see

Happy New Yearinstead of AcceptedThis is amazing

Happy New Year！

i think problems will be short and sweet, exactly like this blog.

Hello guys, I'm back.

Didn't ask.

QUE MIRA BOBO.

Happy New Year

2023Happy new year

0x7e7!Happy New Year dear friends.

One piece is real!!!

Happy 0x7e7!

Happy new year babyyyyyy

I hope this year will be a big start for many good things

wish every contester good luck and happy new year!

This year will surely be lucky :$$$\left ( 2 + 0 + 2 + 3 \right ) ^{\left ( 2 + 0 + 2 + 3 \right )} \equiv 2023 $$$ $$$mod$$$ $$$ (2 + 0 + 2 + 3)!$$$

(((9×8×7)+2)×4)–(5+3)+(6+1+0)=2023Happy New Year to all; wish you all having good increases in rating! Upvote for good luck in all "Hello" contests because my name is Hello3819.

2023 first contest and one one writer. Amazing.

Happy new year to everyone! and good luck for the first contest of 2023.

How difficult will be tasks? div.3?

look Score distribution, and rate of problems u solved, the most of global round is good for everyone.

tourist vs Benq

`HOW WILL WIN??`

jiangly

the difference between tourist and Benq is just 16 porints

jiangly fan is winner :)

Hope to get to Master!

bestest 100% Serbian round

Happy new year to everyone, Hope this year brings happiness to all of your life.

Can't wait to score first negative delta of the year.

good luck

thank you :)

Happy new Year with a new round,good luck all of you.Excited for this round.

sumforces

A B Weak Pretests?? :(

I got -2 because judge is not checking pretest 1 . Please help!! I got penaly because of printing unecessary things T_T

Coders: How many pretests do you want in Task D?

Setter:

Y E SCan't relate

Shit spotted with old jokes.

Still I got wa on tc 67 https://codeforces.com/contest/1779/submission/187858821 Got ac later though.

What kind of visualization techniques i need to master in order to make observations for Problems Like C and beyond. I wonder how problem solvers simulate solutions for Problems like C.

Anyways a Challenging round for me.

Benq is mbappe

Yes, and the tourist is Messi, he will take first place in the next championship.

and you are ronaldo :)

But he is not the real jiangly.

Benq orz. Back to Rank 1!!!!

seeing tourist and Benq submission times giving chills!!!!Benq orz

Good luck on sys tests everyone! ^_^ Hope I won't get fst.

I think the problems setters missed a problem between B and C,there is a bit high jump in difficulty from B to C.

bro in 2nd problem I'm printing 1 and -1 sequence for even and Not possible for odd

still showing WA why ?

Because it is possible to find answers for odd values of n.

For example, for n = 5, we could answer [-1, 2, -1, 2, -1]

it is only not possible for 3. it is possible for odd. prove that if n is odd then numbers in even positions must be equal and numbers in odd positions must be equal as well. now writing some algebra would prove u the right sequence

Because it is possible for odd.

`1 -2 1 -2 1`

— for any two consecutive items sum is -1 and sum of whole array is -1Only N=3 is not possible, for example in case of N=5: 1 -2 1 -2 1 is a good answer.

because it is possible to create a sequence for odd n, only for number 3 you should print "NO"

Atmost2nforces.

D <<< C if you know

SPOILER ALERTDSU

Can someone give a hint on C?

priority_queue

Can't C be solved using Segment Tree with adding and RMQ, as an overkill?

Sufficient and necessary condition: - For all index i < M , sum[i][M] < 0 - For i > M , sum[M+1][i] > 0

The two subparts can be solved using priority queue.The greedy argument is to remove the smallest / largest number encountered whenever the condition is violated

Hint: priority queue

D I got TLE with Segement Tree for some reasonmy sub

Rebuilding your segment tree for every test case costs too much time.

It does seem so. Well that's really stupid of me. But I was in time scramble during the last 20 minutes

Actually D <<<<<<<<<<<<<<< C if you know

big spoilersmonotone stack

There are two corner cases, which i found at the end of the contest. First m=1 (we don't need to check a1 <= 0). Second: (because of this wa2) the sum of prefix a1...am may be positive, neutral and negative(not only non-positive). The solution goes from transformation of inequality(destroy identical terms from left and right and you will get necessary and sufficient condition), given in the task for k>m and k<=m and considering corner cases...

how to solve for n = odd . problem B ?

I have done like this. Let the entire sum be s. So A[0] + (A[1] + A[2]) + (A[3] + A[4]) ......(A[n-2] + A[n-1]) = s => A[0] + (n/2)*s = s; => A[0] = s(1-n/2)

now A[1] = s-A[0] and similarly you can calculate for A[i]'s.

for n=3 . its possible A[0] = 1(1-3/2) = 0.

if n == 3, it is not possible.

otherwise, you can alternate -(n/2-1) and (n/2) to get the ans

You can list n equations. And then, the odd position number is all equal, and the even position number is all equal as well.

Let $$$x = \lfloor \frac{n}{2} \rfloor$$$, then $$$a_{odd} = x, a_{even} = 1 - x$$$. The sum of this array is 1.

the seqance will look like this : $$$ x, y, x, y, x, ... $$$

for $$$n=2k+1$$$ the number $$$x$$$ repeat $$$k+1$$$ times and the number $$$y$$$ will repeat $$$k$$$ times.

the sum of the numbers are eqaul to $$$x(k+1) + yk$$$. thus we have

$$$x(k+1)+yk=x+y\Rightarrow x(k+1)+yk-x-y=0 \Rightarrow xk+y(k-1)=0 \Rightarrow -\frac{xk}{k-1}=y$$$

if we set $$$x$$$ as $$$k-1$$$ we can find an answer.

Let the sequence be:

The problem states that every adjacent pair must be equal to the sum of the whole array, then

So let's take a closer look to this equality

Therefore you'll have something like this

If $n$ is

eventhen we fall into a trivial case wherewhere $$$k = \frac{n}{2}$$$ because you have $$$\frac{n}{2}$$$ pairs of $$$a_1 + a_2$$$. Then you can make this equality work if $$$a_1 + a_2 = 0$$$ so you choose some $$$(a_1, -a_1)$$$

The problem is that for an

odd$$$n$$$ you have the equality like thisAnd that implies that $$$ a_2 = k(a_1 + a_2) $$$ so

For this equality to work you need to make $a_2 = k$ and $$$a_1 = 1-k$$$

The only case where this is invalid is when $$$n=3$$$ because this would imply that $$$a_1 = 1-k = 0$$$ which violates the problem constraints

TLDR: For

odd$$$n > 3$$$ then choose $$$(1 - \lfloor\frac{n}{2}\rfloor, \lfloor\frac{n}{2}\rfloor)$$$ else choose $$$(x, -x)$$$let's say we want to solve the problem using just the integers x and y. let there be

anumbers of x andbnumbers of y. leta = (n+1)/2,b = n / 2.So, the summation of the whole array is

ax + byand the summation of the adjacent pairs is =x + y. After solving the relationax + by = x + yyou get:x = -(b-1) * y / (a-1)now if you take

y = (a-1)you getx = -(b-1)this relation is true for every value of n. for n = 3 you get x = -(n / 2-1) = -(1-1) = 0. as 0 zero is not allowed you print NO

Could someone help? Why I got runtime 187832356

It was a nice contest, thank you. Sad, that i can't solve C... But it's ok, since this one was a quite balanced round

What is wrong with my last submission for C?? Can anyone help me out https://codeforces.com/contest/1779/submission/187833659

I think you'll understand from the test

3 3

1 1 1

I think maybe, you made a mistake in the second for loop, where i goes from m-1 to 1 and u have put the limits as m-1 to 0.

I made a similar mistake during the contest.

Because whatever be the value of a1, condition a1+a2+a3...ak >= a1+a2+....am is satisfied always [a1 >= a1 + a2 + ... am leads to the condition a2 + a3 ... am <= 0].

Would you please debug https://codeforces.com/contest/1779/submission/187786889?

Someone in my room used a set instead of multiset for problem C. it is obviously wrong but i had a very hard time finding a hack test. any ideas ? i tried some numbers and i probably could get a sequence with n = 10 ish but i thought the hack test must be easier. unfortunately i didnt have enough time

Ahh, did the same mistake. Weak pretests

Try

yeah i thought so. i dunno i guess the stress of the time got to me coz i was calculating huge numbers instead of sth easy like this

It was a wonderful round consisting of balanced problems with clear description. Thank you!

Any hint for problem E?

Plot wins as a graph. Look what that graph looks like. What happens with SCCs?

did um_nik tell you that B and C are garbage?

Why do you think they're garbage?

Great contest and amazing problems! Congrats to the author!

i had a negative ammount of fun doing this contest

Love tasks of this type, especially B

Any idea for E? I solved by first build a tree by n-1 queries (first root=1, then for i=2 to n, do query(root,{i}), if response==1 we add an edge from root to i, else we add an edge from i to root, then let root=i), then the final root is CM. Then we try for every node i which is not CM, we do query(i,CM), if response>0 we add i and all of its ancestors into CM. But I just iterated i by natural order then I got WA on test11. Is there any better ways to choose such i to get AC?

Awesome Round!. The problems were very interesing.

First time ever I solved a segment tree problem... I wonder whether D was easier than usual BTW in which category these global round lie?(DIV1?DIV2?B/W?)

Global rounds are div1+2

This is my first time solving F at div2- round and I'm really satisfied with this round. Hello 2023!

isn't D just finding the maximum value in non matching segments of array $$$b$$$ using segment tree for all the values of $$$b$$$ (from max to min)? or am I missing something?

For D: https://codeforces.com/contest/1779/submission/187833014 What is the time complexity of this? Shouldn't it pass?

I am not sure but

`vector<vector<int>> st (k + 1, vector<int> (MAX_N));`

may be slow.Thanks. It got accepted after changing

`st`

and another thingYesterday, I convinced my self not to think about using segment tree as the first thing that comes in to mind. I wont forgive you for making me code a segment tree after trying for an hour to find a solution not involving it :(

What's the problem with this solution of C? Thanks. 187819637

Take a look at Ticket 16657 from

CF Stressfor a counter example.First time used PriorityQueue and SegmentTree in contest (for problem C and D).

benq now on first spot lets see how many days he can hold that position

What's the problem of this solution of D? Thanks for checking my code. 187831769

Try

Thanks for your test case!

Getting strong pe 716 vibes from problem G

Apart from this, thank you for the contest!

Happy New Year Everyone and Thanks Authors for the amazing contest!! Problems were enjoyable

When I attempting F, I was always thinking $$$6$$$ queries is suitable for $$$2n$$$ queries problem...

Yes, $$$2n$$$ makes the problem harder lol.

I have an idea for problem D: sort the razors from small to large, and then think backwards. Assuming that all the hairs are on the termination condition, use the Disjoint Set to maintain the maximum operating range of a razor, and calculate whether the number of razors is enough. However, the result of my submission is WA on pretest 2. Can someone help explain it? Thanks!

my code for problem D

Try

Oh, I know. Thank you!

Starting two were easy and inside i was thinking yeah... new year's 1st contest is going all well.... And here comes problem C.. hmm ok approach done... all done.. But but, what is this Run Time Error on test case 2 bro. :( I got RTE like 3-4 times and at the end my brain was like, lets drop CP for few days :(

Looking at the code block above. Before this block being executed, the value of sum is the sum of a[i] where i>=m, with some of them fliped sign. In the case of (arr[m-1] > 0 && m!=1) the code reset the value of sum to 0, but in the other case, the code executed [+=] which remained the value processed for i>=m. This will cause an error when doing pq2.top() because the value of sum is too large, and there are not enough elements in pq2.

Such kind of mistake, I typed sum+=arr[m-1] instead of sum=arr[m-1] ... Even the test cases didnt help lmao.. THanks for spotting my mistake, much much appreciated mate :)

i love this contest

I'd say problems are nice. Not blaming on anyone, but hope I'm not the only one who think stronger pretests could have made this contest better with less FSTs :)

Happy new year~~

It was my first time that I solve D and only submit it for one time! :)

I love this contest, it's brilliant! And also, problems are very good too!

Nice problems orz n0sk1ll

I don't know that why B give the array a limit of 5n. And it takes me a bit time to think "why the problem gives the limit of 5n?"

btw, I even don't know why when I don't use long long at the C, it returned Runtime Error.

Perhaps the purpose of giving the limit of 5n is let the codes pass which are not implemented best. Also this can confuse someone to think "perhaps the best solution is slightly smaller than 5n", but I think this kind of strict limit could seldom appear in Problem B.

Thank you,FST D.

The problems were really interesting. Thank you authors for the contest.

Maybe I should seriously practice div2As [Lol]. Second straight contest where I had to write a brute force program to find whats wrong with my A

Thanks for the contest! I liked the problems and also the loose limits for E and F (I mean $$$2n$$$), which actually made the problem harder (at least for me).

Nice round.I enjoy it:)

Maybe E does not seem so difficult as F while they shared the same ratings,but that doesn't matter.Anyway,Happy New Year!

I participated after a three-and-a-half-year absence. It was a wonderful set of problems. I'm glad this round was the one after so long.

I've participated after an

exactlythree-and-a-half year absense in GoodBye Round 2022. My delta was -1 and thus my graph looks funny now... but well, Today it's going to get waaaay lower hahaha.Just a random fact, you can continue scrolling.

Multiset...

Did the same mistake, but realized it when solving D, see my submissions :)

What a Contest in which Jiangly's Fan Beats Jiangly

Problems are amazing ,although not able to solve C

Same :(

My bad. Solved D just 1 minute after the contest. Wasted a lot time with C. D was comparatively easier than C. My D submission 187838181 (No heavy algo used).

Pretest of C very weak

Could've solved D if I just had one more minute.. I think it is easier than C but I wasted too much time on C. a sad start of 2023 for me.

How to solve D I am getting TLE https://codeforces.com/contest/1779/submission/187829415

See my Code, just mentioned 2 comments earlier. Think it like histogram.

In problem D, I got AC during the contest, but after the contest it shows me wrong answer in test #1. Acutally it was runtime error for test #1 and I don't know why it passed pretests.

NICE ROUND :)TOURIST ERA IS OVER

bro his rank is 2.

Can someone tell me why you don't check the first index in problem C?

because there is no sum before the first index

Do you mind giving me a case where doing what I did would fail?

wait

How is the correct result 0 if the prefix sums are: -5, -1, 4. Aren't the other ones less than the last?

sorry,this is wrong

first line:1 second line:3 3 third line:5 4 3.your result is 1,but right ans is 2.

I think your make another mistake.

Nah I'm getting 2. I'm talking about my 2nd to last submission during contest.

I use your last submission

Why I don't see my rating? was it unrated for newbies?

Rating is not updated yet.

Congratulations Benq for becoming the number 1 user on Cf... I wish tourist reclaims the spot in the next contest :(

Well Done Benq. Such performance at this young age is really mesmerizing.

How old is he?

21 or 22 I believe

Bruh, this competition completely destroyed my rating. I am not doing CP for a long time now.

I submitted B 3 times out of which first 2 where wrong on pretest 2. So it says — 50 points penalty on wrong submissions. I still cant figure out where those penalty points are cut. Please help Coz i am not able to figure out meaning of penalty on wrong submissions.

Have a look at this blog

can u please tell more about points penalty since yesterday i gave Hello 2023 round and solved A & B que. and i got 2 wrong submissions while solving B one. But i am not able to figure out where i lost my points. https://codeforces.com/contest/1779/my

finally cyan!

Congrats for becoming specialist.

thnx man

Benq orz. Back to Rank 1 <3

Problems are amazing and interesting!

I hoped to be a specialist in 2022,but I became to a specialist in the first contest of 2023.

could someone please explain dsu approach for problem D ??

I was checking the approaches people used for problem D. I found it confusing and complicated I tried making a simple solution using no sorting, segment trees or any complicated data structures and just used monotone stack-

I have made a video on this let me know if you find this useful :here

It is almost the same idea as the famous histogram problem

you meant infamous :P ? it has ruined the interviews of several candidates.

why is the link not working for me

I think there was some issue with the link — I have changed it now could you please check again ?

why round is marked as unrated?

Where is my +99 rating points?

UPD: the rating was recalculated.

round marked as unrated

Were the results canceled?

Can anybody help with my submission of question C 187780125. The test case on which it is wrong is pretty huge :(

Take a look at Ticket 16667 from

CF Stressfor a counter example.thanks

was this rated?

the rating was recalculated and I got additional -1 rating. Sad!

(In the other hand this make me a bit easier to get positive Delta in the next contest)

why round is marked as unrated?

Your solution 187786383 for the problem 1779C significantly coincides with solutions posij118/187758161, lavijiang/187786383.Can I say this is really a coincidence? The solution of problem c is really obvious.I really didn't cheat in this contest.

I got a mail, that my code for problem D matched with someone else, I matched the two solutions and found that both codes had the same function for Segment Tree which I copied from GeeksForGeeks article posted much before the contest. I am linking the two solutions and the GFG article below. Kindly look into it

My Solution

Other User's Solution

GeeksForGeeks article

Dear CodeForces team,

Subject: Regarding plagiarism in HELLO 2023 with submission id:187813049.

Thank you for bringing this to my attention. I apologize for any unintentional plagiarism on my part.

I assure you that I did not intentionally copy code from anyone else. However, I may have inadvertently used code from a source that I thought was allowed.

I understand the importance of original work and the consequences of plagiarism. I will be more careful in the future to ensure that I am not using any prohibited sources and that all of my submissions are my own original work.

Thank you for your understanding.

Shouldn't I report about a guy who asks about solution during the ongoing round?

I have received an email from codeforces, stating that my solution Swizz19/187739966 is the same as some other users for the problem 1731A round div 2 and this is another I'd I have made since the original one got disabled and I'm sure about that my answer is original , but it can be possible that many can think about it in this way, so I think that this is unfair to disable my account without proper checking, and I never used an online compiler . Please consider this again since it would be really disheartening to loose my original account.

Ram Ram