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

Автор EJIC_B_KEDAX, 2 месяца назад, перевод, По-русски

Привет, Codeforces!

Я рад пригласить вас поучаствовать в Codeforces Round 959 при поддержке NEAR (Div. 1 + Div. 2), который пройдет в 18.07.2024 17:35 (Московское время). Вам будет предложено 8 задач и 2 часа на их решение. Он будет рейтинговым для всех участников.

Тема раунда — компьютерные игры!

Задачи для раунда готовили EJIC_B_KEDAX, zwezdinv, green_gold_dog, molney, azureglow и Sokol080808.

Мы от всей души хотим поблагодарить всех, кто оказал помощь в подготовке этого раунда:

  1. Нашего координатора 74TrAkToR за полезные советы и помощь в подготовке задач!

  2. Qwerty1232 за красную заинтересованность в тестировании раунда.

  3. turmax за красно-чёрное тестирование раунда.

  4. makrav, arbuzick, Anonymous_Noob, Hyperbolic за красное тестирование раунда.

  5. ivan.alexeev, alenenok, Kihihihi, azureglow, pakhomovee, plagues, IzhtskiyTimofey, FelixArg, XaRDKoDblCH, meowcneil, AndreyPavlov, djm03178, MylnikovNikolay за жёлтое тестирование раунда.

  6. Mr_Ell, krigare, marzipan, TimVen74, coder8080, MichsSS, PieArmy, tvladm, Vladosiya, bashem за фиолетовое тестирование раунда.

  7. Algolagon, PoDuReMaN, zarubin, IgorA, leoper, kovir_aleksey_korroy, Kosya, Vamperox за синее тестирование раунда.

  8. MakGeoKar, viteli за бирюзовое тестирование раунда.

  9. Sonya_2009, ishaandas1 за зелёное тестирование раунда.

  10. MikeMirzayanov за прекрасные системы Codeforces и Polygon.

Я также поздравляю green_gold_dog с днём рождения и желаю ему удачи на IOI.

Этот раунд проводится при поддержке NEAR!

NEAR была основана в 2017 году Ильёй Полосухиным, одним из создателей технологии трансформеров, и Александром Скидановым как попытка создать систему, которая бы решала задачи по спортивному программированию. О том, что получилось тогда, можно почитать здесь.

В итоге NEAR сделала большой поворот на 180° и начала работу над протоколом блокчейна, который запустила в 2020 году.

В этом году NEAR сформировала новую лабораторию, NEAR.AI, задача которой — создание будущего, в котором технологии искусственного интеллекта открыты и доступны всем, а не контролируются небольшим количеством мега-корпораций.

Одним из направлений работы является обучение моделей мыслить рационально, и задачи по спортивному программированию — это отличное окружение для этой задачи. В этом контексте NEAR приглашает всех участников Codeforces с рейтингом 1400 и выше помочь нам описать решения задач по спортивному программированию. Мы хотим описать решения большого количества задач разной сложности и платим за это сравнительно большое количество NEAR. Присоединиться к системе можно по этой ссылке.

Спасибо NEAR за предоставление следующих призов победителям:

  • 1-е место: 512 Ⓝ;
  • 2-е и 3-е места: 256 Ⓝ каждому;
  • с 4-го по 7-е место: 128 Ⓝ каждому;
  • и так далее;
  • с 512-го по 1023-е место: 1 Ⓝ каждому.

Разбалловка: $$$500-1000-1250-2000-2000-2500-2750-3750$$$

Удачи!

UPD: Разбор

UPD2: Поздравляю победителей:

  1. tourist

  2. ecnerwala

  3. orzdevinwang

  4. Egor

  5. jiangly

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

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

I hope to become expert after this contest ^_^

Good luck everyone and have fun <3

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

Seeing 74TrAkToR as coordinator is quite scary, change my mind.

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

praying for 1434 rating

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

Finally not 3h Div1 but 9 tasks in 150min, I hope the round is not too speedrun.

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

Hello, I am writing this comment, possibly hoping for officials at NEAR to see.

Recently people on Baekjoon Online Judge (BOJ) have seen many DMs on Codeforces, apparently related to the payout for NEAR.AI. They have been asking for solutions (assumably they annotated the tasks themselves but did not have solutions) to many tasks on BOJ. I am gently asking you to remove the BOJ platform from the automated payouts for the AI. Here are a few reasons why.

The BOJ Rules state this is bannable offense.

Through investigation, the users at BOJ had found out that the BOJ account sahera5474 is related to verifying the solution for the payout (though, we did not know exactly what kind of service it was at that time). This kind of automation, not only is condemned by the users, but is also bannable offense according to the rules.

The following is part of what is stated on the rules of the platform (link):

...

Cheating: Cheating states of the behaviour of submitting code that one did not write.

The code that is considered cheating is removed from the site, and according sanctions follow the following rules.

  • User A submits copied code on task B: User A's submissions on task B are removed entirely
  • User A commits repeated cheating: All of User A's submissions are removed entirely

The user reported for cheating is penalized accordingly.

  • First case: 7 day submission ban
  • Second case: 31 day submission ban
  • Third case: 2,147,483,647 second submission ban

...

Clearly, this kind of behaviour is considered cheating on the platform, and is bannable offense.

Most tasks on Baekjoon are not worth any payout for solutions, as they have the solutions publicly available.

For whoever does not know how the Baekjoon platform is maintained, the website contains the following kinds of tasks.

  1. Tasks from user contests/local contests (mostly by Korean people)
  2. Tasks from any other contest apart from the platform (OI, ICPC, foreign local contest, etc)
  3. Personal task contribution (also mostly by Korean people)

For case 1, most such contests contain official editorials, so the solutions are publicly available. For case 2 it is almost the same as case 1, but you will likely have to search outside the platform for the publicly available solution. Most cases where the solutions are not publicly available belong to case 3, but recently case 3 appears much less than case 1 or 2 in quantity. Therefore, an automated payout for training the AI on tasks of case 1 or 2 would make no sense.

Conclusion

Even if one suggests the two points above might not hold for this specific case, it is common sense to consider the DMs from the payout assignees to be considered as fraudulent use of both the Baekjoon platform and your payouts. Therefore, I am publicly asking to remove the BOJ platform from automated payouts and possibly the training data.

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

    Hi, it's not the solutions, but the step-by-step way people solve them that we are after.

    Apologies for violating your ToS, as of right now all the integrations with Baekjoon that we have are turned off, there should hopefully be no folks reaching out to you going forward.

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

      Thank you for the reply! I have outlined in your DMs what could be possibly done to fix the issues in the long term. If you don't mind, please give it a look and tell how you think about it.

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

[user:ivan. alexeev]

seems markdown is not working

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

In NEAR, orange is yellow!

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

Hope to reach 1800 in this round

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

Hope the competition goes smoothly! :)

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

Do I really need coderforces-near-connect-account setting? It is tooooo complicated. Built-in wallet doesnt work and I even need certificate from goverment for proving where I live!

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

As a tester, I

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

Hope it's a good round with strong pretests!

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

I also congratulate green_gold_dog on his birthday and wish him good luck on IOI.

Happy birthday green_gold_dog!

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

As a tester, I hope that everyone will enjoy solving the contest and find a wonderful problems. I wish everyone good luck)

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

Scoring distribution when?

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

sigmaforces

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

As a tester, I can say that problems are very interesting and I wish everyone good luck

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

What is N currency?

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

Why is there no number for this round? Sequential Codeforces Round numbering would be more convenient in many ways. Also, there can be numbering for NEAR rounds since this is not the first round sponsored by this company.

Update: the round has number 959 now. Okay.

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

Hope it doesn't become a speedforces :3

9 problems for 150 minutes ???

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

Is there any reason why most of the contests score distribution follows GCD(score distribution)=50 or 100??

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

    Actually, the GCD is always $$$250 k$$$ ( $$$k$$$ is a positive integer ) because of the rule.
    On CF, if you solve a task during $$$k$$$-th segment of the round when the round is equally seperated into $$$120$$$ segments, you got (max points for the task) $$$\times$$$ $$$( 1 - \frac{k-1}{250})$$$ points (minus, Wrong Answer penalties), therefore, to make the score integer, the max score must be a multiple of $$$250$$$.
    For further details, look at this page (just above of "Hacks") and this comment.

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

As a tester, I was expert when I tested so participate in the contest.

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

    PieArmy can you explain more about your statement ? how does testing of a contest work , is it rated when you test?

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

Good luck everyone.

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

Спасибо!

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

How to change my account because I lose it

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

    If you are referring to NEAR account, send me a DM. I'd need more details to be helpful here.

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

When would the rating rollback happen for the previous rounds?

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

As a participant, I hope cheaters don't ruin the contest. Let's ensure that everything is fair and done correctly.

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

I'm excited!

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

What are the score distributions for the problems?

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

As a tester, I can say that problems are very interesting and I wish everyone good luck

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

Hopefully I get back the rating I lost in last rounds

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

"Dear God, I come to you with a heavy heart, seeking your guidance and wisdom for those who resort to cheating in coding contests. Grant them the insight to understand the value of honesty and integrity, and the humility to seek success through their own efforts. May they realize that true achievement comes from diligence and skill, and may your wisdom guide them to choose the path of integrity in all their endeavors. Amen."

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

please give me positive delta

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

Good Luck!

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

I hope to not become pupil again. I wish the problems to be interesting. I wish there were a round based on specific games and the problems have a story of the game. (Imagine, "Kratos has brought n deers and Atreus wants to eat them with maximum weight first...would be so awesome xDxDxD)

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

    any tips to reach specialist like you? I mean you havent solved that many questions of range >1200/ 1300 but still you are a good specialist

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

      build logic as fast as possible. moreover, i had done 230 questions on my previous id but had to stop it and made this new one. i was solving for quite a time but only from last year or so i started giving contests seriously. trust me problems <2000 are not hard. i strictly believe that you should try your best from your id only as you will be fooling urself. try to stay thinking fast, learning concepts, seeing code of top ones etc. have a zeal to learn. don't give up. choose discipline, not motivation. peace.

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

cout <<" GOOD LUCK EVERYONE "<< endl;

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

Two and a half hours is too short for round 1,2

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

What is "512 Ⓝ" mean? It's name of money type ?

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

another speedforces?

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

The number of problems changed from 9 to 8... So it is going to be speedforces (?) :(

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

    Okay, I'm not fast enough :(. Solved ABCDF but ranked lower than 70% of the ABCDE solvers.

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

Hope @74TrAkTor doesn't spoil the contest

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

surely i wont throw this time

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

nvm

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

i hope to become newbie after this contest, after long time.

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

hope to reach 1900 today

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

I'm 909 rating should I join or I will lost alot rating ?

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

    Join bro, let's lose rating together, don't worry about it, it doesn't matter, what matters is attempting & working on problems, if/when we get stronger, the rating will come. Enjoy.

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

      best piece of words i heard on cp

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

      Thank you for your suggestion I was going to increase the rating because thank God I solved b but unfortunately wrong answer in a

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

      Lord Krishna had said , You have a right to perform your prescribed duties, but you are not entitled to the fruits of your actions. Never consider yourself to be the cause of the results of your activities, nor be attached to inaction.

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

hoping to get under 1k

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

Congratulations, Codeforces checked that I am human in just 5 minutes!

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

bad D

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

Problem C , statement's input is written The first line of each test case contains three integers n , x (1≤n≤2⋅105,1≤x≤109) — the number of mushrooms and the maximum toxicity level. But three integers are not there are just 2, is this a mistake or am i trippin?

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

There is penalties for wa on test1 ???

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

There's no way, I fumbled on B and got humbled by C.

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

The fact that I could straight up ignore the tree structure in E is the funniest thing I've seen in a while hehe.

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

Very very good set of problems! Thank you!

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

C : Hungry Games is a simple application of the famous interview problem Jump Game. I created a video editorial for today's C.

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

    There is also a linear solution: for every l find first r such that $$$\sum\limits_{i=l}^{r} a_i > x$$$ (you can do it with 2 pointers), then calculate a $$$dp[i]$$$: number of segments with i as left border such that game on these segments will end with some none-zero score. $$$dp[i] = (right[i] - i) + dp[right[i] +1]$$$.

    You can add a fictive $$$+\infty$$$ element to the end of array, also $$$dp[right[i] +1]$$$ should be added if only $$$right[i] < n$$$ (numeration from 1).

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

      Can we do the same by going from $$$1$$$ to $$$N$$$ and calculating number of segments with i as right border?

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

        Yeah, sure

        Just keep in mind that array $$$right$$$ can not be easily transformed into $$$left$$$ (with analogical meaning), you need to find $$$left[i]$$$ explicilty with 2 pointers going from $$$n-1$$$ to $$$0$$$.

        The rest actions are completely symmetrical.

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

how to be good at problem like C

I'm going down green again 💩

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

Just thought about Pigeonhole principle in problem D at the last minute of the contest.

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

    explain please

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

      Also thought of it, but couldn't code it in time. The basic idea is that you have n-1 operations at most, but n elements in the array. Hence, no matter what operation, it is guaranteed you get two elements which are divisible by the operation number. I couldn't really prove that this will extend from any operation to all operations, so a proof of that will be nice.

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

      For each $$$x$$$, it's easy to see that we only can pick two vertices $$$u$$$ and $$$v$$$ when they have the same modulo $$$x$$$. So what we can do after knowing this? Suppose we solve this problem in the reverse order of $$$x$$$, i.e iterate $$$x$$$ from $$$n - 1$$$ to $$$1$$$. Then we can blindly pick any two vertex $$$u$$$ and $$$v$$$ such that they are not picked in the previous steps and have the same modulo with the current $$$x$$$, and we are done. And the fact that this problem always have the answer $$$YES$$$.

      So why does it work? Let's consider the first iteration when $$$x = n - 1$$$. Then, when we modulo all $$$a_i$$$ with $$$x$$$, we will have at most $$$n - 1$$$ different outcomes. And according to the Pigeonhole principle, if we have $$$n$$$ elements and $$$n - 1$$$ outcomes, there will be at least two $$$u$$$ and $$$v$$$ have the same modulo, so we choose those two $$$u$$$ and $$$v$$$. And the same procedure could be applied in the next iteration, as after the previous iteration, we will care about $$$n - 1$$$ vertices so we could apply the Pigeonhole principle again until $$$x = 1$$$.

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

what was D?

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

    At each stage i, take A[j] mod i for each j. Vertices with the same remainders can be connected by an edge. Pigeon hole principle guarantees that you can always find an edge that doesn't create a cycle.

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

      I got the first part, but what is the pigeon hole principle? And how would you go about finding those edges?

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

        Ok I forgot to mention that you have to reverse the process and add edges starting from stage $$$i = N - 1$$$.

        When stage $$$i$$$ begins, you currently have $$$N - i - 1$$$ edges added. Let $$$rem[k]$$$ be a length $$$i$$$ array denoting the number of vertices that falls into the remainder of $$$k$$$. So clearly the sum of $$$rem[k]$$$ is equal to $$$N$$$. Now for contradiction, suppose that adding any valid edge to the DSU will create a cycle. This implies that for each group of vertices that falls into remainder $$$k$$$ bucket, these vertices form a connected component. This implies that there are $$$\sum_{k = 0}^{i - 1} rem[k] - 1 = N - i$$$ edges currently part of the DSU. but This is clearly a contradiction, as we started out with an assumption that there are currently $$$N - i - 1$$$ edges in DSU.

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

        And for finding those edges, well, you just have to find two vertices within each remainder group that have different roots of the DSU.

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

    Pigeonhole Theorem.

    For any $$$m$$$ numbers, there exist at least two numbers with the same value modulo $$$m-1$$$.

    So the answer is always yes.

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

      I got this, but how to show that the 2 nodes with same modulo also weren't connected via some previous set of edges?

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

        Suppose currently we have $$$k$$$ elements, and $$$x = k - 1$$$. After we choose two vertices $$$u$$$ and $$$v$$$ in the current iteration, then in the next iteration, we will only need to care about $$$k - 1$$$ elements as we can ignore $$$u$$$ or $$$v$$$, and the Pigeonhole Theorem could be applied again.

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

        Do it backwards: start with stage $$$n-1$$$ and keep going until $$$1$$$, then reverse the answer later. At stage $$$x$$$, let's say vertices $$$a$$$ and $$$b$$$ are the same mod $$$x$$$. Connect $$$a$$$ and $$$b$$$, then erase one of them (i.e. ignore it for the rest of the problem). This way we are sure that the same set is not connected twice. At each stage we remove one element, and we start with an extra element ($$$n$$$ elements at stage $$$n-1$$$). So this means that at every stage we have an extra element. Hence, pigeonhole guarantees the existence of two elements with same mod in every stage.

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

Was D a variation of Hall's Marriage Theorem where there are more nodes on one part of the bipartite graph? I didn't have enough time for it, seems like a fun problem though :(

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

    no it was just observing php

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

      Yeah, I was searching for a way to do a pairing between the diffs and the nums from $$$1$$$ to $$$N-1$$$, but it seems you cannot go wrong with it...

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

I actually saw F before: https://codeforces.net/gym/101879/problem/C

Something something traktor bad something something

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

d hint?

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

Are pretests = sys tests? I'm 90% sure that my solution for problem D is bs, but somehow it passed 30 pretests.

Actually the solution was fine, for $$$n$$$ numbers and $$$x = n - 1$$$ at least two numbers will always be equal modulo $$$x$$$, by removing 1 number then we get $$$n - 1$$$ numbers left and $$$x - 1$$$, so pigeonhole principle repeats itself.

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

    I hope so, I am pretty sure my solution can be TLEd, but it passed pretests as well...

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

The most speedrun round I have participated. I feel they are too classic for D1.

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

Tags for D??

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

How come there are so less submissions for C?

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

How do you think and come up with the solution for B?

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

    If $$$s$$$ only has 0, you cannot modify anything. Otherwise, every index from the first 1 to beyond can be modified at will.

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

    Once we simplify operation, we understand that in one operation, first $$$x$$$ elements of $$$s$$$ we can XOR with first any substring of $$$x$$$ elements in $$$s$$$, for any $$$x$$$ we chose..

    Now if the first bit in $$$s$$$ is 1, we can clearly make any string $$$t$$$. (Remember that XOR with 1 flips a bit, and XOR with 0, it remains the same.)

    Now if the first bit in s is 0, but second bit is 1, we can make any string $$$t$$$ whose first bit is also 0.

    And so on.. So the final answer: the first position where 1 appears in $$$s$$$ must be <= first position where 1 appears in $$$t$$$, if it possible to make $$$t$$$ from $$$s$$$.

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

Solved ABCD, but I am below people that only solved ABC or ACD...

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

Great set of problems!!!! But Internet and "Confirm you are not a robot" costed me 5 minutes on A :(

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

what is the idea behind D?

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

Upvote if you think that the penultimate problem of a prized CF round having almost 200 solves is a great idea

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

Man, the limits in C were pretty harsh. This got me a MLE: https://codeforces.net/contest/1994/submission/271247958. And this one got me TLE for some reason: https://codeforces.net/contest/1994/submission/271261706

Both solutions exceeded the problem's limits despite being O(N^2), I guess my rating is plunging once again hehe.

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

    Usually $$$n \leq 2 \cdot 10^5$$$ indicates that $$$O(n^2)$$$ solutions will not work. There was a $$$O(n\log{n})$$$ solution for the problem.

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

    mine

    void solve(){
        int n,x;cin>>n>>x;
        ll a[n],p[n];
        REP(i,0,n)cin>>a[i];
        p[0]=a[0];
        REP(i,1,n)p[i]=p[i-1]+a[i];
        ll count=0;
        int dp[n]={0};
        for(int i=n-1;i>=0;i--){
            auto it=upper_bound(p+i,p+n,p[i]+x-a[i]);
            int j=it-p;
            dp[i]=(j+1>=n?0:dp[j+1])+j-i;
            count+=dp[i];
        }
        cout<<count<<'\n';
    }
    
    signed main(){
        fast_io();
        int t=1;
        cin>>t;
        while(t--)solve();
        return 0;
    }
    
»
2 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I went through hell and came back while trying to solve B.

Anyways, great problem set! Thanks for the round EJIC_B_KEDAX zwezdinv green_gold_dog molney azureglow Sokol080808 and all testers!

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

G = https://codeforces.net/contest/1670/problem/F

Do the coordinator and the problem setter believe that DIV 1 + 2 equals DIV 3 ?

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

I had a very bad experience.The network is terrible.codeforces keep verifying me “are you a human?”. And the statement on m1.codeforces.com is somewhat not available.So I can only read the problems on my phone and solve the problems.After about half an hour am I able to visit the page normally.And now and then it needs verifying and the page just stuck there for minutes,which is quite annoying....

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

Will my solution for C be accepted if its O(n^2)?

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

Fucking Speedforces :(

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

Didn't want to participate because I didn't sleep well last night, read problem E in bathroom, realized solution was simple, turns out I was one of the first to get accepted lol.

Solution is just count occurrences of bits of sizes of trees, if a bit occurs twice you can turn on every other bit below it. The shape of the trees is not important

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

    how did you reach this conclusion ? ( in the last line ? )

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

      You can get any size removing leaf by leaf. Then, if you have more than one tree with the i-th bit on, you can remove leaves from other trees to turn on all the bits less than i.

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

        Hii, Suppose I have two trees of size 8, Both trees are of the form: Root is 1 , and 7 other nodes attached to root 1. 1st tree will give me 8, Can you please tell how will you generate 4,2,1 using the second tree? I can generate either (4 and 1) or (2 and 1) but not all three simultaneously.

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

      You can always delete some unimportant leaves, so if the size of some tree is $$$N$$$, you can get a tree with any size less than $$$N$$$. If you reach a tree size of $$$2^m$$$, by removing 1 more leaf you can set to $$$1$$$ all bits less than $$$m$$$.

      Too bad I spent a lot of time figuring out if my solution for D is correct or not, E wasn't actually difficult at all.

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

Someone just ping me when the editorial is out I'm only able to solve A,B and tried D but TLE :) , As my first contest solving 2 questions is fine ? :')

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

c was wild

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

I had to reevaluate my whole life while solving B and C today.

But overall nice problem set!

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

In problem B, what will be the answer for this testcase : 0110

0101

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

    Yes.

    Apply operation $$$(2, 3)$$$ to make it 0100, then $$$(3, 4)$$$ to make it 0101.

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

speedforce

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

E got WA on pretest 11 and don't know why :(

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

When I was finally able to open the very first problem statement (which was problem A, but I wanted to start with B or C), the timer already showed more than one minute passed since the start of the contest. During this time I tried to use m2.codeforces.com, but it told me there is no access to the statements. The main site was either displaying the connectivity error message or asking me to prove that I am a human being.

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

I just can't solve problems anymore xD

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

;!

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

Super easy solution to H: 271267941

code
  • Query 1: ask aa -> learn p
  • Query 2: ask S = (z 50 times) -> learn a = X mod m (where X is base value of S)
  • Query 3: ask some string with base value $$$X - a - b$$$ where 1 <= b <= a + 1 -> learn m

You learn m because $$$(X - a - b) \text{ mod } m = (((X - a) \text{ mod } m) + (m - b)) \text{ mod } m = m - b$$$.

To form string for query 3, first subtract 1 from the base value by reducing the first character by 1, then subtract something between a and 2a. To do this, just consider how many multiples of every power of P you must subtract to subtract a. If it is at most 24, subtract that straight from the letter. Otherwise, subtract 1 from the next letter. This works because P <= 2 * 25, and every letter is subtracted at most once from the carry, and at most by 24 directly.

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

With more and more coordinators like 74TrAkToR who would place the G at G, I'm sure it will soon become a trend for users from all rating ranges to solve problems A ~ G in Div 1+2!!!!!!!!! Very refreshing speeeeeeedy round, love from Botswana

UPD: The trend also appeared in past Div2 contests like 1891F.

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

Nice round!

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

I got in top 1023 places but I'm not specialist yet. How can I gain my prize? Haven't NEAR thought about people that have <1400 rating??

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

    Try participating from your main account next time.

    • »
      »
      »
      2 месяца назад, # ^ |
        Проголосовать: нравится -35 Проголосовать: не нравится

      Yes I am sorry for using my alt account (to make it seem less severe, the first round I'm taking I'm having a headache so I decided not to risk it and thought rounds with money must be participated with this account eversince). But actually the thing I'm most concerned with is there may be other main <1400 rating accounts who have missed the prize.

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

    nice hoping you did it by urself

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

I spent one hour trying to know how to find the Euler circuit but failed, and I saw this problem at least twice before... This round should not be a division 1 and should be an educational round. Additionally, Codeforces was intermittently down during the contest.

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

    In my opinion, understanding the Euler circuit problem is important for problem F, but not all of it.

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

Thanks for the amazing test cases in problem D.

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

Got the idea of A in first 5 mins but it took me 30mins to implement it I am such a dumb:(

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

fapipotato orange when (v_v")

hope for positive delta and road to lagenry grandmister!!1! (^o^)/

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

It wasn't until I saw the "int foo" in the tourist's E-question code that I realized I was just a fool.

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

WTF????Extortion???

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

(Problem F)

It is guaranteed that you can reach any house from any other by walking on the roads with NPCs only.

I think that the constraints on the input should be written not only in the problem statement but also in the Input section.

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

    You're right. Sorry, missed that when editing the statements. The validator checks that, of course.

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

I'm sorry,but I want to say that it's a rubbish contest because the rank depends on the speed,not the knowledge you have.In the other words,if you have enough knowledge but little speed,then you will fail in this contest.But OI and things like that needs a lot of thinking and the knowledge is more important than speed.This contest can't train contestants to think or to learn.So I think it's a bad contest.Hope that author can have more high-quality contests!

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

Can someone suggest me some source for

$$$dp$$$

questions on codeforces so i can practice and learn??? I'm really afraid of the topic and want to overcome that fear.

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

I finally became blue :)

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

    If I understand your question correctly, the link you pasted is generally the right way to onboard to Acadé Studio (modulo the right handle instead of ~).

    Feel free to ping me via DMs if something doesn't work.

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

Hi i got rating (0) does that mean its a +0 or its a glitch :(

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

F: There weren't any extreme cases such that

2 500000
1 2 1
1 2 1
1 1 1
1 1 1
...

Some bad implementation of Eulerian Circuit (including my contest submission) got uphack, so if you're afraid I suggest you to resub to check.

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

The problems are so known that even chat gpt can solve it

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

About C, I think this question is enlightening:

https://atcoder.jp/contests/arc169/tasks/arc169_b

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

Why the time for 1+2 is 2h. I nearly passed G but I had no time at last.

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

Yoo ,C was a good educational question.Got to learn something new.Thanks

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

I like TrAkToR:)

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

    It seems a lot of people didn't like this round, but I liked the round. The cloudflare issue wasn't that bad for me. Apparently there were repeated problems, but I hadn't seen them, and I thought F was interesting.

    I think people deserve second chances. Let's support 74TrAkToR !

    • »
      »
      »
      2 месяца назад, # ^ |
        Проголосовать: нравится -23 Проголосовать: не нравится

      Couldn't agree more! Even though most of these problems have shown up on leetcode and code.org (jk haha)

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

Thanks for decent quality contest.

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

It's really a great SpeedForces Round.

Here's my thought during this round.

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

I have some problem with my near account. I didn't copy my Private Key or Seed Phrase and now I can't login. Is there any solution or who do I need to find for help?

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

tourist is back

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

Can anyone hack or explain my solution in problem C?

i don't know why this pass. TwT

271325693

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

Stuck in B forever Gang

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

Very good trush round!This made my brain quickly rotate.

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

I should've won 1 NEAR and after the contest I opened my NEAR account and it shows the amount to claim is 0?

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

Downvoted

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

I should've won 2 NEAR and after the contest I opened my NEAR account and it shows the amount to claim is 0?

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

    The prizes for this round have not been entered into the system yet.

    It takes several days after the round to filter out all the duplicate submissions and finalize the standings.

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

for problem 3 and I solved the question with a good amount of time and also got a wrong submission . But codeforces saying my code is same as of someothers . Just check it : My code :https://codeforces.net/contest/1994/submission/271254358 Others code ( given by codeforces) : https://codeforces.net/contest/1994/submission/271237089 How it could be simillar I agree the intution is quite simillar. And its very simple to be . Please recheck it and give me back my rating .

(There are many one Who have also the same code as the others but they didn't got any plagrism) Also Got an solution https://codeforces.net/contest/1994/submission/271241875 which is as same as the others but this account did't got an plagrism . I appriciate the thing of plagrism it should be more trict but at first it should be more accurate.If giving plagrism please check it out carefully. My Submission : 271254358 Othhers Submission : 271237089 One's Submission same as others but didn,t get plagged : 271241875

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

    Same with me I submitted after a lot of Wrong answer at almost closing time of the contest on my own.But I received a mail that mine coincides with a lot others.

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

      Bro . Thats Good that they are checking but its wrong that giving plag to the genuine code

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

Dear Codeforces Team,

I am writing regarding submission 271253205 in contest 1994. I have been flagged for plagiarism, but I would like to emphasize that my code and the flagged submission may share similar intuition, but they are not identical.

I have invested significant effort in solving this problem, and my last submission was just before the contest ended. I understand the importance of maintaining integrity on Codeforces and respect your responsibility in ensuring fair play. However, I kindly request you to review my submission separately from others that have been flagged.

I am willing to discuss any concerns or provide additional clarification if needed. Please reconsider the decision and avoid banning my ID outright. I am confident in my abilities to regain my rating fairly, but I hope to resolve this misunderstanding promptly.

Thank you for your attention to this matter.

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

Hello, [submission:271243589][submission:271238016], i have got email from CF that my solution is copied from the other solution. I want someone to please check and help me what thing i copied, as i have not done any kind of cheating. i am new to this platform and getting this email is discouraging. How to stop it and avoid in future if someone can guide me , and what mistake i had done in the solution that seems to be copied, i am not getting that point. Its was question with general answer. Please someone guide me and help. And request CF to remove cheating tag from my solution.

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

Subject: Clarification on Solution Similarity and Account Suspension

Dear Codeforces Team,

I received a notice about my recent solution (ID: 271257872) matching another submission. I want to clarify that, while the approach may be similar, I used my own code snippets and did not copy any solutions. After two unsuccessful attempts, I submitted my original solution. Please note that my other two submissions, which have no allegations of copying, were also skipped.

Additionally, my old ID (Anas_006) was suspended for a similar issue. Could you please inform me of the expected time for its reinstatement?

Thank you for your understanding and assistance.

Best regards,
suplex_city