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

Автор yse, 16 месяцев назад, По-английски

أهلاً, Codeforces!

cry, Intellegent, and I are really excited to invite you to participate in Codeforces Round 1029 (Div. 3), which will take place on Jun/08/2025 17:35 (Moscow time). You will be given $$$2$$$ hours and $$$15$$$ minutes to solve $$$8$$$ problems.

The round will be hosted by rules of educational rounds (extended ICPC). Thus, all solutions will be judged on preliminary tests during the round, and after the round, there will be a 12-hour phase of open hacks. After the open hack phase, all accepted solutions will be rejudged on successful hacks. Also, note that there is no score distribution but the usual penalty of 10 minutes for each wrong submission, following the rules of educational rounds.

Note that the penalty for each wrong submission in this round is 10 minutes. Also, note the rule restricting AI use. If you are caught using AI in an unorthodox manner, you will be sent to cry's basement. You don't want that to happen.

Remember that only the trusted participants of the third division will be included in the official standings table. As it is written by link, this is a compulsory measure for combating unsporting behavior. To qualify as a trusted participant of the third division, you must:

  • take part in at least five rated rounds (and solve at least one problem in each of them)
  • do not have a rating of 1900 or higher at any moment in time.

Regardless of whether you are a trusted participant of the third division or not, if your rating is less than 1600, then the round will be rated for you (unless you register unrated).

I would like to thank the following people for making this round possible:

Good luck, and most importantly, have fun!

Edit: Tutorial

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

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

As a tester, the problems are good. I recommend participating.

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

wowee

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

As a tester, -firefly- tested.

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

As a tester, yse held me at gunpoint to test this round.

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

As a tester, I contributed an initial AC solution that was later hacked.

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

as a participant, I hope it's all sunshine and rainbow down cry's basement :D

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

hi

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

Where is cry's basement?

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

if only i had gone down by 7 more rating :(

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

I hope.

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

"note the rule restricting AI use. If you are caught using AI in an unorthodox manner, you will be sent to cry's basement. You don't want that to happen."

The FBI is here to search cry's basement.

»
16 месяцев назад, скрыть # |
Rev. 7  
Проголосовать: нравится -14 Проголосовать: не нравится

amazing ^_^ yeah yse and yeah Borhom

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

2 problems at least this time

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

Ok but what if I want to be sent to cry's basement???????

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

As a participant, I hope to reach expert

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

The king in this world joo

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

Hope get Specialist.

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

يا هلا

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

As a tester

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

As a participant I hope the problemset is amazing , and I reach pupil ^_^

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

My turn

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

If you are caught using AI in an unorthodox manner, you will be sent to cry's basement.

Could you please elaborate on the specifics of this? Will I be sent via plane, train, or car? If it's a plane or train, will my ticket be paid for? If it's a car, will one be provided or would I have to provide one, in which case would my gas be comped?

Thank you.

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

As a first-time tester, this is the best round I have ever tested.

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

As a participant, I wish you all a "failed system test" and "hacked" free contest

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

How to apply for the post of torturer at the cry's basement

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

As a basement, you don't want to use AI then end up in cry's tester.

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

As a tester, I can confirm cry is a Honkai: Star Rail enthusiast and his basement aims to produce free Stellar Jade.

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

Why Sunday but not Saturday?

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

As a person, it would be an Intellegent move to participate in this contest.

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

Hoping that problems will not be hard

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

as a participant, I want to see cry's basement so add another way than cheating plz :/

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

First out of competition div3!!!

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

Wish everyone enjoys an exciting match:)

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

Eid Mubarak :)

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

i have a doubt why i dont see manypeople coding in java? it seems theres enough time given in questions to code in java but alot of people dont do it

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

    Java is a ~4-5 times slow than cpp , so most people prefer cpp over it in cp

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

    C++ is the most popular because it's (one of) the fastest languages, which can be particularly helpful when avoid TLE (time limit exceeded). Python is also decently popular, mainly for beginners, because it's easy to learn. Java's in the middle ground, and while a jack of all trades can be popular in some cases, generally its not used as much (though it's not unused, I do think its still decently popular, but not as much as C++ and python)

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

As a tester, I have a proof that upvoting this comment will lead to positive delta. But the proof is too long to fit the margin.

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

as a tester, i tested late so i will miss out on all the contribution :C

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

این دنیا دیگه به درد نمیخوره

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

cry and Intellegent have never disappointed us.

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

Are we are not going to get the problem rating breakdown as in div 2

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

Be careful in this case, the output may be yse.

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

Eid Mubaraak !

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

excited for the only thing that makes me happy, good luck to all

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

good luck

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

I hope you achieve the best results and wish success to everyone.

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

gl hf

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

my current rating is 1599. finger crossed :3

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

Make sure you done end up in his basement

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

Nice contest. Had fun solving them. Thanks !

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

m2.codeforces.com down for anyone else? for me only question heading were visible but on clicking them the statements were empty.

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

C made me cry a lot.

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

I took way longer than necessary on D. Spending the rest of the time on E and probably overcomplicated it as well. Solid problems I suppose though.

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

how do you solve E?

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

    for each index i for array a check if some a[i] exists in odd position relative to i in a OR some a[i] exists at even position relative to i in b,also we need to check for indices greater than.Same for array b.if its true for any array ans is atleast i+1.We can implement it using multiset

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

What is the idea on problem D? I'm sure its something easy, I just can't solve it (even though I've solved E and F...)

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

    System of equations in 2 variables. So solve it for a[0] and a[1], (ensuring the sol is non-negative integers), then test that sol on all the rest.

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

    Assume there are x first operations and y second operations, then you get two equations:

    a[i] — a[i-1] = x — y (1) a[0] — x — ny = 0 — (2).

    Solve these two equations and check x >= 0 and y >= 0, also check x — y = a[i] — a[i-1] is same for all i.

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

    I first tried to imagine it as a linear equation. And instead of trying to reach 0 from z, I tried to reach z from x and y. Let

    • x = [1, 2, ..., n]
    • y = [n, n-1, ..., 1]

    We want: a * x[i] + b * y[i] = z[i] To solve it, I used z[0] and z[1] to form two equations and eliminate a, which gives a unique formula for b = (2*z[0] — z[1]) / (n + 1). Once b is known, a = z[0] — b * n. Then just check if all values satisfy the equation

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

very nice contest!!!

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

How to solve C

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

The rated top 5 are all cheaters? Mike, check and delete cheaters from the score board. And, we need roll back. Codeforces don't need any cheaters.

To cheaters: is using LLMs so interesting? You can't learn any thing from an AC and a good rank. your same large camel code stile and super long AI names are strange!

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

Great Round. Esp for me , C and E.

Any hints for F?

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

I don't understand how any author would find it an achievement to write a problem like E. It's so boring and seems to just be a time-waster problem. You could have just left it at no deletions, but you decided to make it cringe. There is also like nothing to learn from it

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

How to solve H?

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

Some ideas for problem G? I tried the following but it gets WA on test 2, don't know why yet:

Insert the edges one by one using the Kruskal/DSU algorithm for MST, but stops immediately when 1 and N gets in the same set. Then, find the mininum and maximum edge in their connected component, and output their difference.

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

D is hard to implement for me ... and I think C and E have similar ideas and difficulties (maybe E even easier?)

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

What is the solution to F, I have no observation but the tree is a binary tree if ans > 0.

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

Is H based on sqrt decomposition? Here is what I had in mind:

  • If f(i) denotes the frequency of an element at index i, we need to maximize difference on function: 2*f(i) — i.

  • We can store maximum answer for each distinct value over queries.

  • To make an update (addition/removal), we maintain blocks of size sqrt(N/logN) over each distinct value. This way when an update happens, we can update all the elements of the block of that value to recompute minimum and maximum: 2*f(i) — i. Also we can keep a lazy offset to compute the changes in answer for each of the other blocks. Once we manage to update each block, we can recompute the distinct value iteratively and update it inside the global maxima set of answers.

Is my idea sane enough?

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

Can someone explain how rankings work in rounds were there is no score distribution ? Is it solely based on problems solved independently of their difficulty ?

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

    Yes ranks are on the basis of number of problems solved

    to settle ties, they are then ranked by penalty(sum of time taken to solve each problem, with +10 for each incorrect submission)

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

Really enjoyed this contest! Thank you :)

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

Why does the author think that 100 line of if else is cool for E, or my implemention is just dumb.

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

Hello , I am actually a newbie to codeforces and was not very much aware of the system , i did registered as rated contest and even solved three problems in the contest ,but it is now showing as unrated for me , can anyone help me and is there anything which i can do to get my rating increased ?? ...

If possible , do consider helping my submission id's are

https://codeforces.me/contest/2117/submission/323499358

https://codeforces.me/contest/2117/submission/323470875

https://codeforces.me/contest/2117/submission/323448302

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

I tried to solve D, using the fact that when a[n-1] = 2*a[n], I will do operations only of type 2, and the conditions, a[n-i] = (n-i+1)*a[n] should hold for all i, so first I calculated how many operations of first type are required to get a[n-1] = 2* a[n], apply that much operations of 1st type to the entire array, and then check the condition which I told. But I am getting wrong answer on test 3, can somebody please look into my submission and tell the probable error, https://codeforces.me/contest/2117/submission/323482331

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

Omg graph! I am also a Chinese problem author, and i can't believe that one day the Codeforces div3 will be exactly the same as my idea. https://codeforces.me/contest/2117/submission/323561607

https://ac.nowcoder.com/acm/contest/103864/G This is a problem I prepared about six months ago, it was used for a programming competition for a Chinese university student called the Chuanzhi Cup.

Dramatically, I didn't attend last night's Div3 because I had to review for the final exam. And I have always participated in Div3 from the second to last problem, which was the problem G for last night. It's obvious that I lost the opportunity to get first blood on this problem.

Anyway, I am honored to have the same problem as Codeforces. :)

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

Can we solve D with Binary Search?

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

why i ac D yesterday, but today i saw D is still in queue?

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

where is my rating, I'm starving. /cry

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

Hello,

I participated in Codeforces Round 1029 (Div. 3) with a rating of 368. I made submissions during the contest and my handle appears in the official standings, but my rating hasn't been updated while others have received theirs.

Could you please check if there was an issue with my rating update?

Thank you.

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

As a tester, Help me figure out why this CPP solution works but not the same python one. CPP: https://codeforces.me/contest/2117/submission/323463628

Python: https://codeforces.me/contest/2117/submission/323479416

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

Can someone check why my F solution is giving TLE on Testcase-3, I don't know why it is doing like this. Even some Time-complexity calc showing its O(n). Please help me.

The function is solve6() for F part.(You have to scroll a bit) 323699490

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

    You pass the adjacency list v by value in the calc() function, which creates a new copy each time you call the function. Pass it by reference and it should pass.

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

Questions were interesting and was fun to solve

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

I just tried the virtual contest today, these problem were so fun! Really regret forgetting to join the actual contest yesterday :')

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

.

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

Hi Codeforces team,

I’m very sorry for the trouble my submission 323500727 caused. I honestly didn’t know that using a small helper tool could make my code look identical to someone else’s.

The core idea of the solution was my own. Because it was already late and I was very tired, I let a tool generate some quick boilerplate code and then completed the rest myself. I never copied anyone’s contest code and never shared mine. It seems the same boilerplate appeared in other submissions, so the checker flagged us as similar.

I no longer have the local files (I cleaned my workspace after the contest), but I can explain every step of my solution if needed.

I guarantee this will never happen again. I respect Codeforces and will make sure I do not compromise the fairness and integrity of any future contest, and I am willing to accept any penalty you consider appropriate.

Thank you for understanding.

— MNTEEOKK