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

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

Neko Nya, Кодефорсес =^● ⋏ ●^=

Я рад пригласить вас поучаствовать в Codeforces Round 926 (Div. 2). Он состоится в 15.02.2024 17:35 (Московское время) и в нем вы будете помогать мальчику Саше добиться девочки. Раунд будет рейтинговым для всех участников с рейтингом строго меньшим 2100. И у вас будет 2 часа, чтобы решить 6 задач.

Тута благодарность всем соучаствуюшим в раунде:

Жду всех на раунде >~<

UPD: Разбалловка: 500 — 1000 — 1500 — 2000 — 2500 — 3000

UPD2: Разбор

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

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

As a tester I highly recommend you writing this round!

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

cutie FairyWinx

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

Finally, a catgirl round!

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

As a tester,this round has a clear and concise statement. I highly recommend you to participate :)

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

As a tester,this round has a clear and concise statement. I highly recommend you to participate :)

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

Score Distribution of the round??

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

Score Distribution of the round?? Score -> Updated

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

uwu

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

Kudos to the authors for continuing the trend of attaching their photos!

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

OWO

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

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

nya

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

scoring distribution???

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

Пришлось поменять аватарку на Тайлера Дёрдена для этого раунда. Stay hard! Stay focused!

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

Няшкаааа

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

~ Огоонь! ~

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

score distribution ?

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

Sasha is a determined young man, and he's not afraid to use his programming skills to win over the girl of his dreams. In this Div. 2, Sasha will have to solve 6 problems in 2 hours. But with the help of the cutest coordinator Artyom123 and the best platform KAN, geranazavr555, MikeMirzayanov, Sasha is sure to succeed. And if he needs any help, he can always count on the legion of testers: A_G, AgafonovArtem, Alexdat2000, Vladithur, wuhudsm, petyb, induk_v_tsiane, sevlll777, mz1, SomethingNew, AVdovin, NewLul, damirsit, and skylak3_3.

Good luck, Sasha! We're all rooting for you!

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

    Thank you, but you'd better help me and solve as many problems from the contest as you can.

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

У автора аниме головного мозга, мне нравиться

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

>.<

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

What about the streak of announces with photo of authors???

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

Hope to become expert in this round.

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

Score distribution? ≽^•⩊•^≼

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

GOOD LUCK

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

Why do I feel like I'm being called for by the announcement? (•‿•)

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

╱|、
(˚ˎ 。7
|、˜〵
じしˍ,)ノ Good luck to all ≽^•⩊•^≼

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

дождались

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

I don't have a GF in real life, and I also can't use my limited coding skills to help you. So sad......

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

the cat is cute

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

koshka

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

I'll try my best to solve problems to help a boy named Sasha win a girl's heart. ≽^•⩊•^≼

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

"Давайте продолжим серию анонсов с фотографией авторов :)"

Из предыдущего анонса

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

РАУНД ОТ ЮРЫ КОТОРЫЙ ОН ОБЕЩАЛ В КОМАНДЕ ОСЕНЬЮ!!

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

kawaii catgirl !!

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

You are cute !!

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

No girls, only hardcore

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

Love the theme of this round. Let's goo. Hopefully it is a good one. All the best everyone❤️

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

Short round blog !

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

I hope I can solve 3 problems!!!

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

GOOD LUCK!!!

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

Such a short and clear announcement I hope problems statements be like this too!

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

Short statement Blog … nice

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

Either way gonna sweat on 14 or 15

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

Hope to become expert in this round!

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

Mid sem from 19 but CF round is the first priority

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

kawaii neko ^-w-^

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

As a tester, i wish good luck to all participants.

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

Sasha, I'll try to help you get her number)

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

But I knew Sasha is a girl's name from AOT .

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

что означает neko nya?

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

Nice of you to keep up the trend of problemsetters including their photos in the announcement

Oh, just noticed that I'm not the first one to think of that(

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

hoping to win heart three times very quick....

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

сэмпай, сшка решаемая?)

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

Hoping to get more of "Good luck and high rating!"

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

Hoping to do better after a disastrous run of contests.

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

hope for the best....

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

its either cyan or gray time no inbetween for me

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

В итоге эта девушка окажется 40-летним мужиком, решающим этот контест в подвале своей мамы

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

Doesn’t the average tester rating seem quite high? :)

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

Hopefully I can do the first four problems!

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

I hope everyone has a good score.

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

I want to solve ABCD

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

A lovely catgirl! I have to take part in this round. Will I become a catgirl after this round?

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

WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOH

I finally have a legitimate reason to show my catgirl side in front of others. So after this contest I'm going to meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow!:3

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

that is crazy

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

I see that FairyWinx has created a round, I'm happy to register.=^● ⋏ ●^=

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

cute catgirl.

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

New profile picture

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

catgril !!!

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

Кто этот прекрасный человек который написал такое в описании раунда? На инфе надо мной весь класс угорал

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

Looking forward to "Good Luck and High Rating"

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

all the best

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

All the best

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

Neko round lets gooo!

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

As a particapant i alreary know this is gonna ne a great round

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

Good Luck to all the participants.

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

lovely score distribution (´・ω・`)

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

I need someone to help me,as sasha

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

As a participant I like the vibes

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

As a participant I like the vibes

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

lets see if this sasha(me) can be specialist or not,, wish me a good luck..

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

I need someone to help me,as sasha (*_^).

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

IDK that Codeforces changes its name to Kawaiiforces now =✪ ᆺ ✪=

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

сане везет, вот мне никакие программные решения не помогут уже

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

I might top this round

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

anime = gay

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

I will start from $$$C$$$

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

Wanna help Sasha badly

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

Finally, score distribution released

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

Nice score distribution

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

Even in kindergarten, Sasha liked a girl.

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

I'm a bit confused, I guess I forgot registering for contest, and there's timer stating: "Before extra registration", yet I'm unable to register? New here. Edit: my bad

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

i love catgirls

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

C statement is not clear to me?

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

    Same, no idea what its asking. The sample tests seem to contradict the problem statement

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

      I have the same issue with the problem, I even tried to guess it with samples (which shouldn't ideally be the case), but still I don't get it.

      They should add some explanation to more sample cases, or add extra information in the problem.

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

In C I am not able to understand the condition for Yes

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

very unclear statement of problem C.

Spent 30min reading the problem and just 5min solving it.

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

    can you explain problem statement ... testcases are contradicting from problem statement, why testcase 4,7,8,9 are no

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

For Problem C the explanation is the most unclear explanation I saw

Edit : Thanks for answering our questions by " do not ask questions " XD

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

sasha is such a simp rizzing girls in kintergarden.. phh

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

i dont get the c question . is it math ?

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

    same, the cases are making no sense according to the test case

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

      yeah after the hint i finally get this . pretest 7 was something very hard to find

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

        In case of 3 3 6, Can't I always bet 1 and get as many coins as required. I am taking the case where there is no consecutive x losses

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

          1 1 1,

          If you win in 3rd time then you get 3, you achive 3-1 = 2 extra. But you already loss 2.So your coin will be no change.

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

        Hey can you please hint me on pretest 7? I failed it and could not figure out why :(

        I start with y = 1 and s = 1 (where y is the money I spend on this round, and s is the total money I have spent). I loop x times, each time update y to 1+s/(k-1) and s to s+y. Finally I check if s>a (i.e. if I have enough starting money for the worst case).

        Edit: Okay.. I just figured out long long is not enough, I need unsigned long long... This makes me feel bad :(

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

Few testcases are literally so weird w.r.to the problem statement.

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

I just think C is clear.

In which aspect cant you understand the statement?

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

    why wont he bet all his money after he end the losing streak , that way he doubles his money and he can get the amount he wants?

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

      I was initially thinking the same but there is a catch and that is what this problem is all about.

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

        cant see the catch , if u dont mind explaining it to me ,after the contest ofc.

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

          Well the casino can 'fuck him over' by giving him a win just before he is guaranteed to win, making him go into a cycle of losing money.

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

            How this works for the test-case 3 3 6?

            Sasha can bet just 1 coin in each round:

            • 1 coin — lost

            • 1 coin — win; receives 3 coins, total coins = 6 — 1 — 1 + 3 = 7

            And so on... Any amount can be created with just 1-1 coin bets!

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

              What if he loses for the first 3 times !! Then he is remaining with 6-3=3 coins.. Then if he again uses just 1 coin, he will be left with 3+3=6, so no improvement, right !!

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

                But, what after loosing 3 times, he bet with the amount 3.... this time he will have total score of 9

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

                Yes, but if he loses first 3 times, as x is 3, won't he bet all his coins for this round.

                • Bet 1 coin — lost
                • Bet 1 coin — lost
                • Bet 1 coin — lost
                • Bet all 3 remaining coins, as x is 3, so total coins now, 6 — 1 — 1 — 1 — 3 + (3*3) = 9
                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  3 месяца назад, # ^ |
                    Проголосовать: нравится +1 Проголосовать: не нравится

                  Dude, the point is that the casino can LET HIM WIN on play 3, think about that case

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

                  But how is gonna know when he will win or lose !?

                  He can lose max k times in a row..suppose when he uses 1 coin, he wins but when he uses 3, he lose ! :(

                  His goal will be to make 7 coins from 6, right !

                  Then, that can recursively increase to 8, 9 ans so on..

                  Step 1: He can use 1 coin: If he wins, he is left with 6-1+3=8 (>=7) But he loses, left with 5

                  Step 2: He can still use 1 coin: If he wins, he is left with 5-1+3=7 (>=7) But he loses, left with 4 now.

                  Step 3: Now, if he uses 1 coin, even after winning, he will be back to 6..which is less than 7.. So, he must use 2 coins.. If he wins, OK But he again loses, so left with 4-2=2

                  Now, he is bound to win..but at max he can reach upto 2*3=6, so no increment..

                  I hope you guys get it :)

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

                  Thanks for the explanation. I understood it now!

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

              Take a look at my other comment where I explained the 3 3 6 case.

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

          The casino can decide whether to win or lose if there are no more than x number of games. If you keep betting on one dollar and win in the middle, the total amount will be smaller.

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

            so should i keep betting one and see if i run out of money or not?

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

              Each winning streak resets, and if the casino allows you to lose money in a losing streak, the total amount will not go up no matter how much you bet.

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

                so if after the first streak, my money is decreased , that means he lost or what

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

                  Of course it means that he loses because he can't possibly have more money than the principal.

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

      there is no guarantee that he will lose every single one till he gets the guaranteed win. His lose streak could go zero at the x-1st try.

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

D is not clear at all what's wrong with the writers

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

    I think the contest is made for the writers to understand only <3

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

      What's amazing is that dozen of LGMs just solve anything, I wonder do they need problem statements at all? )

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

        From their experience they solved many problems so they know what the writer want by reading some main points from the statement, one day we will be some of them <3

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

          Yeah, that makes sense indeed. It's like extra skill to be able to understanding the message from a pile of random words.

          At least this round showed me the area I need to practice it a lot :)

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

    It's pretty clear if you ask me, and English isn't even my first language. Can it be worded better? Definitely. But the statement along with the testcases are adequate I think

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

very bad contest "A7A" very bad description

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

now I won't participate in any contests which have something like love stories in the problems, first diskoteka and his stories about Vika and now this one.

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

Bring back competitive programming please.

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

There is some real BULLSHIT going on with me cout << ceil (value of something); is apparently incorrect in some cases but if We take, ans = ceil (value of something) cout << ans; is correct This is disturbing

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

    cout << ceil(value) returns a floating-point value and ans = ceil (value of something) cout << ans; will typecast that float to integer (assuming ans is of int or long int type)

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

      Thnx Bro didn't know that, it just caused me an hour, so I knew ceil of(val/2) is equivalent to (val+1)/2 so I just randomly changed it to: cout << (val+1)/2; and I was even more furiated when this got accepted :(

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

Why are we gambling on codeforces?

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

felt Question C was not clear at all

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

I wish I could have visited Casino once :(

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

печально, грустно, зря потраченная время (

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

WTF the language of problems is so uncertain and hard to understand,like in b i didnt saw sample test case,and confused in what diagonal means, in c what any number of coins means was also uncertain and i read d 12-15 times and didn't understood the problem, plz work more on problem statements,it sucks

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

Unromantic problem wordings :(... Dreams tonight for ppl solving D, E, and F:

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

i gonna give u a downvote,unless the people who wrote these questions became a cat girl and date with me. :)

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

Rigged ah casino , house always wins!

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

C is an interesting problem that is very poorly worded

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

C is the hardest problem, change my mind

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

Problem D can be solved using the technique of adding children incrementally to a tree, for which I've recently created 2 tutorial and 2 practice contests.

Tutorial 1 and Tutorial 2

Practice Contest 1 and Practice Contest 2

My submission using the ideas from the tutorial.

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

I feel dumb to be unable to solve C. Goodbye Specialist and welcome Pupil :(

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

D and F are very standard, while C was really hard (for me).

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

    I saw F after the contest. Seems easier than D and E unless I'm misunderstanding the problem..

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

    True wasted time on C.

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

    I wonder why D was very standard? It was easy to see dp can be use like dp(i,j) where j={0, 1,2). But according to your dp definition dp(i, 1) it was like simple path starts from i then go to the below leaf node having only one dangerous node. while my definition was simple paths that passes from current node i and have only one dangerous node. Due to this change you are making combination of childs in dp(i, 1) and this also helps in later calculating i parent node dp(par, 2). But according to my definition I have to make those combination in dp(i, 2). B/c if I will consider more than 1 children having 1 node in dp(i, 1) Then it will become 2 dangerous nodes as my definition says passes from current node. But due to this it is missing some cases in calculation of i node parents dp(par,2).

    So my point was many people could come up with my dp defintion as it give a sense that we are considering all the simple paths. Because you are only considering paths starts from node i . Here's a comment Link of someone having same assumption. I think I can AC it with one more array for storing those combinations. But it will become more complex. So Please could you share some problems using this same thinking difference I can relate it with and consider this as standard problem .

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

The easiest div2 contest I've ever seen (but understanding problem statements is harder than solving them).

A: max(a[i])-min(a[i])

B: If you color cells (1, 1), (1, 2), ..., (1, n), (n, 2), (n, 3), ..., (n, n-1) by this order, you color 2 new diagonals for each cell. And coloring (n, 1) and (n, n) will fill last 2 diagonals. So the answer is ceil(k/2) if k<4*n-2, 2*n if k==4*n-2.

C: Suppose you place a bet of t[i] coins if you've lost i times in a row (0<=i<=x), in order to make the number of coins increase, we must have k*t[i]>t[0]+t[1]+...+t[i] for each 0<=i<=x, and t[0]+t[1]+...+t[x]<=a. So we can calculate t[i] greedily: t[i]=floor((t[0]+...+t[i-1])/(k-1))+1.

D: We consider 2 types of good set: First, assume we take node 1 as root, and for any two different nodes (u, v) in the set, u is not the ancestor of v. In this case, we can calculate the number of valid sets by dp: dp[u]=1+prod(dp[v]), where v iterates over all childs of u, and the number of sets of the first type is dp[1]. Second, assume there exist nodes (u, v) such that u is the ancestor of v. In this case, the set must be contained in the subtree of u, and if we remove u from the set, there will be exactly one child of u, such that the set is contained in the subtree of that child. For each edge (u, w), there are dp[w]-1 sets of second type(we need -1 because {u} is already counted as first type).

E: Let mask[j] = the set of paths that the j-th edge is contained in. We can calculate them by brute force in O(n*k). In fact, there can be at most 2*k different values of mask[j]. Then we let dp[mask]= the minimum number of edges we need to color paths in mask, then we have dp[0]=0, dp[mask]=min(1+dp[mask&(~ t)]), where t iterates over all values of mask[j]. Then we can solve the problem in O(k*(n+2^k)).

F: First turn the binary tree into an array by pre-order traversal, and prepend 1 at the front and append C at the end of the array. Then for each maximal block of consecutive -1 in this array, let L be the number before this block, R be the number after this block, and t be the length of this block, we need to fill this subarray by t numbers within [L, R] and sort them in non-decreasing order. By a well-known conclusion, there are C(R-L+t, t) ways to do this. Because sum(t)<=n, we can calculate it directly and solve the problem in O(n).

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

    how to prove In fact, there can be at most 2*k different values of mask[j].?

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

      Let's prove this by induction. Situation for k==1 is obvious. First, the intersection of several simple paths in a tree is empty or a simple path. Therefore, for any M>0, S(M):={j: mask[j]==M} is empty or a simple path. Then when we add a the k-th path, if S(M) is contained in the new path, then S(M) will become empty (and S(M|(1<<k)) will become previous S(M)). If S(M) have no intersection with the new path, it will remain unchanged. Otherwise, S(M) will have intersection with the new path but not contained in it, and this can only occur at two ends of the path. Therefore, the number of different values of mask[j] can increase by at most 2 when we add each new path.

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

        thanks (●'◡'●)

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

        Thanks for the explanations. But I do not agree with some points in this proof (or I may have misunderstood you):

        1) Based on S(M) being the set of edges i whose mask[i] is M, "S(M) is a simple path" is not necessarily true. Although S(M) must be a part of a simple path (the intersection of paths in M), but it does not necessarily has to totally cover it.

        2) "The intersection can only occur at two ends of the path". We can have cases where 2 paths intersect at their middle.

        A case demonstrating the previous 2 points:

        If we add the paths [5, 6] and [7, 8], S({[5, 6]}) = {(1, 2), (2, 5), (3, 6)}, S({[7, 8]}) = {(1, 4), (4, 8), (3, 7)}, and S[{[5, 6], [7, 8]}] = {(1, 3)}. Also, the intersection between the 2 paths did not happen at any of their ends.

        3) "the number of different values of mask[j] can increase by at most 2 when we add each new path", this is not necessarily true, consider the following case:

        If we add paths in the following order: [4, 5], [6, 7], [10, 11], [12, 13], and [11, 12], the addition of [11, 12] introduces 5 new different mask values ([11, 12] with every previously added path as well as [11, 12] alone). And we still have mask values for each of the previously added paths alone, e.g., mask[(2, 4)] = {[4, 5]}.

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

          I think we could rephrase the statement to something like "There's always an order of insertion such that the number of mask values increases by at most 2 for each new added path"

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

        Therefore, for any M>0, S(M):={j: mask[j]==M} is empty or a simple path.

        Is this correct though? Assume that we have a tree

        1-2 2-3 2-4 1-5 3-6

        We have a path 3-4 and another 6-5

        In this case, S({5-6}) = {3-6,1-2,1-5}, which is clearly not a simple path.

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

    E big brain, I just did $$$ans$$$ or-convolutions (so $$$k^22^k$$$ total)

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

      Still found it easier than D (probably exactly because I skipped the thinking part)

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

      Could you please further explain your approach with or-convolutions?

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

        Let's solve the following problem: let $$$S$$$ and $$$T$$$ be two families of subsets of $$$\{1, \ldots, k\}$$$. Let's find $$$f(S, T) := \{s\cup t\,\colon\,s\in S,\,t\in T\}$$$.

        If we find out how to do this, the original problem is easy: start with $$$S = \text{the set of all submasks for the edges}$$$, $$$T = \{0\}$$$ (or $$$\{\varnothing\}$$$ in the set-theory language). While $$$T$$$ doesn't contain the full mask, increase the answer by $$$1$$$ and replace $$$T \leftarrow f(S, T)$$$.

        To find $$$f(S, T)$$$, we just create two arrays of size $$$2^k$$$, fill $$$1$$$ at all positions corresponding to the masks that are present in $$$S$$$ or $$$T$$$ respectively, then calculate the or-convolution of them. Now at position $$$m$$$ we have the number of pairs $$$(s, t)\in S\times T$$$ so that $$$s\cup t = m$$$. If this is not zero, replace this number with one. Since this number cannot exceed $$$3^{20} = 243^4 < 256^4 = 2^{32}$$$, we can calculate this in unsigned ints and be fine (I even calculated it in signed ints, though their overflow is technically undefined behaviour).

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

    for Problem C, I was thinking of the below 2 conditions (t_i is amount bet in ith round):

    1. k * t_i > t_1 + ... + t_i-1 (if at any point we need to restart it covers for previous losses) for all i in 1 <= i <= x

    2. k * (a — (t_1 + ... + t_x)) > a

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

    in F, I guess it is in-order traversal.

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

    I estimated different values of mask[j] $$$k^2$$$ during the contest. (it's much easier to prove)

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

C problem sucks!

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

Can anyone explain the testcase "3 3 6" in problem C?

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

    The rationale for that test case is very poor. I was also confused about the same. They are stating that the casino will always play optimally, and so the player will always just break even, if they apply the best possible strategy.

    Basically, the casino is rigged against you and it's not a game of luck.

    Very poorly prepared problem.

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

      From the statement, which hasn't been modified:

      "In other words, is it true that for any integer $$$n$$$, Sasha can make bets so that for any outcome that does not contradict the rules described above, at some moment of time he will have at least $$$n$$$ coins?"

      Does this not make it clear that this isn't a game of luck?

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

        I understand it now. It was tricky wording to understand without having context.

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

    same

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

    Suppose we want to guarantee a profit if we ever get a win. This will ensure that we won't play more than x+1 games. Because if we lose all x games, the x+1st game is guaranteed to bring a profit.

    Now considering the 3 3 6 case, lets place our bets like this: 1, 1, 2, 2

    You can check and see that, if we at any point except for the last one we get a win, we will be in a profit. But what in the last case? If we win on the last bet we are going to be back at 6 chips. That way the casino can keep us in a loop forever, therefore never giving us a profit.

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

      why do we have to make a profit, can't we just break even(no profit no loss).

      In other words, is it true that for any integer n , Sasha can make bets so that for any outcome that does not contradict the rules described above, at some moment of time he will have at least n coins.

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

        why do we have to make a profit, can't we just break even(no profit no loss).

        If you always break even and never make any profit, how can you reach $$$7$$$ coins in the above example?

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

    If you want to bet all at once on x+1, then the casino can let you win the penultimate game; If there is a bet of more than 1 in bets, the casino will keep you losing, and your total amount will still be less than 6 even if you win the x+1 game.

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

      This makes sense , Maybe they should have worded it like a two players playing optimally type problem.

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

    Bets can be placed in the order 1 1 1 2 (repeating this sequence if achieved a win before).

    Doesn't this guarantees a win? Probably I understood the question wrong :(

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

Treeforces

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

╱|、
(˚ˎ 。7
|、˜〵
じしˍ,)ノ It was a awesome round. I solve 3 problem. I hopefully reached specialist ≽^•⩊•^≼

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

The integer range check for problem C was DIRTY but NECESSARY.

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

The problem C was very ambiguous and confusing. The test cases were poorly explained, and clarification provided extra information not included in the original problem. This should have been a two-player problem where both players play optimally.

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

    Part of the task was understanding that the worst case scenario in a random setup is an adversary.

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

      It was never stated that the task had an adversary. A casino is supposed to be random. If I can break even in the worst case and profit in the best case, then I will eventually profit. It is not stated that the process is not random but deterministic, it is a fault in the problem.

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

        When you analyze an algorithm like quicksort, does the universe tell you there's an adversary making it as unsortable as possible? No, but that's how worst-case analysis ON a RANDOM process is conducted.

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

Please, do better problem statements.

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

    If I hadn't given that explanation, I might not have been able to understand the C in this game

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

I am going to be a gambler!

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

Took me 1 hour to understand C (in fact I used that time to solve D, but couldn't).

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

    Because understand statement is part of solution

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

      So, you didn't think this might be an issue?

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

        If it's difficult to understand what it means to get an arbitrarily large number and what an adaptive strategy is, then you probably just aren't ready for this task.

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

      Correction: understanding

      I think I know why the statements were unclear.

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

Could anyone please explain C? I thought I would bet 1 coin for x times, so after losing x times i have a-x coins. Then i can simply bet the entire remaining amount, right? But the test cases dont match. Someone please help me out!

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

    Me too!

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

      It's worse than Good Bye 2023.

      If nothing else, my name is going to be gray (and within 10 rating of green).

      UPD: Just looked at it with the plugin, down to 1199 rating...

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

    casino is smart he will only let you loose x-2 times and will make you win on x-1th time so the counter starts again, i realised this in contest but still could not solve it :(

    think of it as two player game with condition that player 2( casino ) can't win more than x times

    EDIT: added second paragraph

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

    we have to think that every time, from the 1st to the x+1th time,
    if we win the bet we will make a profit, but if we lose, we will lose the least.
    And we have to check that we can do this without running out of initial money.
    sorry for my bad english.

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

    You're assuming that the casino would make you loose if you bet 1 coin, they also want you to loose as much coin as possible. So what if they let you win if you bet 1 coin so that the streak for x breaks and then they can take the bigger amount of coin.

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

hint for D pls?

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

    Root the tree at vertex $$$1$$$. Try to find out all the configurations of subtree at node $$$u$$$ such that all upward path to node $$$u$$$ have a maximum count of black vertices as $$$0$$$, $$$1$$$ or $$$2$$$.

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

For D, I tried to find the number of distinct paths of length in the range [3,n]. For this I copied the code for the problem Fixed-Length Paths II of CSES Problemset Link. Then I subtracted this value from 2^n (Total no of possible sets). But my answer didn't match with sample test cases. What was I doing wrong ?

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

    Number of distinct paths of length >= 3 does not equal to number of subsets such that at least path exists with length >= 3.

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

l don't like this time in rating:b+(600~800)=c,a=b and c=d

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

Problem C was like a horror experience

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

С>D=E=F

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

i dont wanna stay in grey forever :(

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

Can someone explain the 3rd question of the 4th question, how does Sasha lose? Sasha always plays 1 If the number of consecutive losses is less than 3, he always gets at least 1 point If the casino gives 3 losses in a row, Sasha will have at least 3 coins and get at least 9 points As a result, he can always increas his mony

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

    They don't necessarily lose three in a row.

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

    "He always gets at least 1 point If the casino gives 3 losses in a row"

    What If the casino doesn't?

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

      Well, if they don't do this, then we have a maximum of 2 losses in a row, and with the next win, the number of his coins will be -2 + 3

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

        No, after losing a game, the losing streak is reset to 0.

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

          Can you explain more?

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

            Initially, you have streak = 0, money = 6

            If you bet 1 and lose streak = 1, money = 5

            If you bet 1 and lose streak = 2, money = 4

            If you bet 1 and win (the casino can control this) streak = 0, money = 6

            It's back to the beginning. :D

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

Anyone can explain problem statement of D atleast then i could think of solution.

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

    +1

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

    +1.

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

    I will simplify the statement in a more straightforward way.

    There is a tree given with $$$n$$$ nodes. Let's say you choose a subset of nodes, then you will mark those nodes in the tree in red, now this subset of nodes will be called "bad" if there is any possible simple path in the tree such that there are more than $$$2$$$ red nodes lying on it.

    You have to count the number of subsets that aren't "bad", the subset can be possibly empty.

    PS: I also had to read several times to come up with some understanding of it. The terms "city" and "intersections" are confusing together.

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

Pretty good round, the hardest problem was getting to the round in time

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

Statements be like:

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

Thanks for the great problem C FairyWinx.
I surely enjoyed the clear problem statement and will cry to bed tonight with a 5-digit rank and -100 delta. Thanks once again.

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

B — непонятно, зачем было разделять рисунок на две части, когда можно было просто нарисовать все диагонали на одном квадрате.

С — нужно было в условии написать, что казино само оптимально выбирает исход всех ставок, это бы упростило понимание.

D — просто ужасная формулировка, понятен вопрос задачи, но непонятно, как читать условие.

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

    Читать условие надо сверху вниз и слева направо

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

OHHHH catgirl power! I may become purple this round!

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

Give me some hint for D pls

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

    u can see my code, use dp.

    dp[u][i] means in u's subtree (includes u), pathes that start with u has a maximum of i dangerous node (i ∈ {0,1,2})

    for the staus's transformation, u can look through my code or just think with yourself.

    Code

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

      For me, dp is a lifelong enemy:(

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

      Why do paths that start with root node correspond to number of sets? Are we covering all the paths, what about the ones that do not start at root?

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

    Tree ᓚᘏᗢ

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

Am I the only one who couldn't find the logic behind problem C?

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

I like how the contest concluded that the best gift for your girlfriend in Valentine is a binary search tree.

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

The problem statement of C could have been better if it has that announcement in a note

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

I can understand what C means, but I can't understand D... I guess the questioner wrote the question in his native language and then used software to translate it into English, just like this comment.

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

The problem statement of C could have been better if it has that announcement in a note

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

Sample tests for prob D are just rubbish

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

Literally it took me half an hour to understand what problem d wants to say btw thanku for the contest

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

Didn't know Codeforces was a gambling site :(

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

I'm very glad that I solved CD and nearly F. Thanks for the problemset!

TreeForces

D: I think my solution 246547495 is strange. I did 2 passes of DFS and DP on the tree, and the calculations are not that straightforward.

F: How do you manage to calculate C(C, n) mod M where C=1e9 and M=998244353? Neither preprocessing or Lucas worked. Or is my solution not the intended way? 246561698

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

IELTSforces

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

There is a participant in my room submitting obfuscated solutions to avoid getting hacked. I think that conduct is against the official rules of the contest. Who should I report this issue to?

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

In my opinion, dear Fairy Winx should learn human language before learning programming language, so as not to put such unclear and incomprehensible questions in the context.

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

System test was fast, anyways

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

Do you know "Ha Jimi" ?

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

After this round, I will definitely not get involved in gambling.

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

for c explain why 3 3 6 is NO: 1-you put 1 coin, if you win you+3-1, you+2 if you lose: you put 1 coin, if you win you+3-2, you+2 if you lose: you should put 2 coins this time, because if you put 1, he let you win, then you+3-3, it means you didn't get anu coin, that why you can't get n. if you win you+6-3, you+3 but if you lose, you have only 2 coins to put you will+6-6 so there is no way for you to make coin must get up, so is no

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

Get a job Sasha!!And stop Gambling!!

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

Very unbalanced

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

I think it will be beneficial for ones who has known about the "doubling bet" strategy to solve C, although it is just the case when k = 2.

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

D easier than C I think.

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

I still cant comprehend problem C . It should have been bit more clear .

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

I get the error "wrong output format Expected integer, but "2.6917e+07" found" with Problem B in test number 4.

How to fix or avoid that error?

246566145

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

    Transform your answer into integer but not float.

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

    This part you cout after doing division with 2.0, so the result will be a float (That's why it has the e+07 part)

            if (2 * n >= k)
            {
                if (k % 2 == 1)
                {
                    cout << (k - 1) / 2.0 + 1;
                }
                else
                {
                    cout << k / 2.0;
                }
            }
    
»
3 месяца назад, # |
  Проголосовать: нравится -6 Проголосовать: не нравится

bad statement for problem c

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

Sasha's girlfriend confirmed imaginary.

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

I think problem C statement is good, at least you can figure it out by yourself that casino isn't always gives you win only after $$$x$$$ loses. Maybe it would be better if it had been written "you don't know will you win or lose, but you guarantee will win after $$$x$$$ loses in a row"

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

One Moment of Silence for all those who struggled the entire contest in problem-C...

(Just because of unclear statements).

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

Very poor statement of the problem

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

for C just think there is one man who control you lose or win, and you should find a way to get coins more. so, for every bet you should think if this turns you win your coins how to increase. so, if you have lost k-1 coin, you should put 2 coins next time, if you don't do it, the man will let you win and you will get k coins but you have spent k so your coin didn't increase. so, if you have lost b coins, next time you should put b//(k-1) +1 coins. for my code https://codeforces.com/contest/1929/submission/246544539

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

Great contest ! Any hints for D ?

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

This code must get TLE,but why am I get Unsuccessful hacking attempt?

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

In my opinion F<<D... So why is a BST written in the statement? Just to make it scary and match our past impressions of the difficulty of problem F?

btw why is C (in F) up to 1e9, not 998244352?

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

    For the C in problem F: Both options "overflow" the binomial, as you need to use the stars-and-bars method, so it does not matter.

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

Can someone say what really problem C ask for? I can comprehend nothing

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

If D appeared in an Atcoder contest, here's what the statement would've been.

Given a tree, you need to color each node in black or white. How many colorings exist such that the path between any two vertices contains atmost 2 black vertices.

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

    Yes, Atcoder is very good at writing statements . Nothing rubbish is written unlike todays C.

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

    can you give me the link to the contest?

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

      I didn't mean that it has appeared in an Atcoder contest. But if it did appear, this is probably how the statement would've looked like.

      BTW, I did reword the problem according to this statement in this mashup contest

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

Bad statements

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

any hint for B...please

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

    Think about how much the number of diagonals can increase if we color in a single square. Also, think about how to include all diagonals with the least amount of colored squares.

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

    If k!=4n-2 then the ans is ceil of k/2. If k==4n-2 then ans is (ceil of k/2)+1 because some cells will have only one unique diagonal. Take n = 5 and 1<=k<=18 and draw a grid with diagonals and try to find ans for each k then you will understand what I am saying.

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

I really hope that Sasha was able to win the girl's heart.

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

I recently came with a rule that in a contest when there are multiple submissions then last pretest passed submission will be used for system testing and previous submissions are skipped. In this contest, I submitted 1st question under 2 minutes and got pretests passed (Submission id- 246491221) and i accidentally submitted similar code again after almost 1 hr 50 minutes (Submission id-246561262) and as per rule my 1st submission skipped system testing and 2nd submission got accepted which made my score drop and my rank drop from nearly 3300 to 5330 which will affect my rating.

I wanted to request that there should be some feature to lock any submission you want and not just last pretest passed submission as it is just taking penalties/lower scores without any reason. And also, if no submission is locked then next submission should only be tested if previous submission failed system testing which is done in some of the contests.

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

    There literally is a feature to lock your submission. Furthermore, after this you can read the codes of other people from your room to this problem, and if you think the solution shouldn't work on some test you know, you can even provide the test and get some points if their solution fails!

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

      Ah, I reread your comment and understood that you want to lock a submission that is not the last one

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

        Yes, exactly i haven't locked my 1st correct submission and submitted it again. Then i was trying if i can lock my previous submission but was not possible and instantly my score and rank was dropped.

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

for Problem C, Are these 2 conditions correct (t_i is amount bet in ith round):

  1. (k — 1) * t_i > t_1 + ... + t_i-1 (if at any point we need to restart it covers for previous losses) for all i in 1 <= i <= x

  2. k * (a — (t_1 + ... + t_x)) > a

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

How to solve the C? I think binary search

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

Test data for D are weak. Many people just printed ans + 1 or even ans + n + 1 without performing modulo, but they still got accepted.

Here's a hack that creates an answer that is exactly 0 — or 998244352 + 1: https://codeforces.com/contest/1929/hacks/983200

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

E>>F

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

In problem C , how for test case : 2,3,15 , answer is yes ?

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

    betting sequence 1 2 4 8 in any scenario you you atleast once have total coins > initial coins so after that you can repeat the sequence and get as many coins

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

someone please explains the problem C.

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

    you can't lose x times continuously and win/lose is random so your win expectation is >money you've lost. do this x times if your money isn't 0 you must win money.

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

I think that problem C was not clear before the announcement was made and it became clear afterwards

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

Can C be solved using Binary Search??

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

can't understand the mean of C

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

Can anyone explain me the D question.

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

Can anyone explain me D

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

"Sasha" lol, it reminds the character "Sasha Blouse" from AOT.

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

I feel like the problem set is rather imbalanced.

A B C all math

D E F all trees

also E, F is of similar difficulty (from number of solves). Should make F harder I think.

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

Hey guys, I saw this blog post about problem C. This is really unfair for many of us who legitimately participate in contests on our own. https://codeforces.com/blog/entry/125935

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

I did problem C with what seems a solution identical to the other ones, but I kept getting Incorrect Answer 7, can someone please explain what is wrong? Thank you

https://codeforces.com/contest/1929/submission/246537505

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

    If I am not mistaken, my code failed on the test 2 1 6 for which my code wrote YES, but the answer seems to be NO, can someone explain this?

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

      i am new at CP ,was this contest rated because i didn't got any rating.

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

    The value of prev_sum can overflow out of long long datatype. You need to break early if prev_sum > a at any point.

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

couldn't escape expurrt after spending first 30 min trying to understand D >;-;<

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

Although I was not a participant in this round, the Problem and sample analysis of Problem C was terrible and bewilderingly.

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

luv u in:)

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

No-sigma raund

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

Why the f is that my problem d was in russian : |

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

C is nice , bit hard to understand

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

quite hard ....

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

deleted content

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

Problem D is a good introduction to DP on Trees. For training purpose, I added the problem to a mashup and simplified the problem statement, so that it's easier to remember it by name.

You can access it here.

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

"Please do not ask questions about test cases in the example that are not explained. We cannot answer them, as it is a hint to the solution of the problem."

this was the most naive response I have ever seen. I believe I'm not the only one that thinks that the statement was a real mess.

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

As a newbie my small brain got fried trying to understand the question no C :))))

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

Problem C statement was not clear ...

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

Me to ques C ---> Link ;-;

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

Problem C video solution with live coding: https://youtu.be/XRjHt1rnzqs

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

I spent too much time on problem C and Did not attend problem D which was easy . Problem statement was not clear and ended up with negative rating change.Regret giving this contest(T_T).

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

great contest, and love the catgirl!

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

I've got no idea why my code for D doesnt pass the official test.

It says that it expects output '12' (instead of '11) on test number 2.

But when I run this test locally I get result '12' :O

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

We need more anime rounds. Please naruto

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

I love the concise statements.

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

Sasha Lol, it reminds the character "Sasha Blouse" from AOT.

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

D is an easy version of https://atcoder.jp/contests/abc340/tasks/abc340_g. Just set Ai=1.

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

Is E's hack opened?

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

dislike! dislike! dislike! anime Haram!!!!! Don't put anime

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

I failed Sasha. He will be single forever.

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

this c i feel bad QAQ

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

Can anyone please tell me why my answer is wrong?

#include <iostream>
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
 
int main(){
	ll t;
	cin >> t;
	while(t){
	    ll k, x, a;
	    cin >> k >> x >> a;
	    bool flag = true;
	    ll lost = 0;
	    ll bet = 1;
	    for(ll i = 0; i < x; i++){
	        if((bet * (k - 1)) > lost){
	            lost += bet;
	            a -= bet;
	        }
	        else{
	            bet = (lost / (k - 1)) + 1;
	            lost += bet;
	            a -= bet;
	        }
	    }
	    if((a * (k - 1)) <= lost){
	        flag = false;
	    }
	    if(flag){
	        cout << "YES" << endl;
	    }
	    else{
	        cout << "NO" << endl;
	    }
	    t--;
	}
}
»
3 месяца назад, # |
Rev. 5   Проголосовать: нравится -16 Проголосовать: не нравится

In the statement of problem C: "Note that the bet amount must always be a positive (>0 ) integer" and "Sasha also knows that there is a promotion at the casino: he cannot lose more than x times in a row." As we can see.. two very clear RULES. the statement also says: "is it true that for any integer n , Sasha can make bets so that for any outcome that does not contradict the RULES described above, at some moment of time he will have at least n coins." Meaning, the casino must never let his money reach 0 -THE FIRST RULE IN GAMBLING IS THAT YOU MUST HAVE SMTH TO GAMBLE WITH OTHERWISE YOU HAVE LOST-, and if he reaches the limit of losses in a row, the casino must make him win -THE MADE UP RULE OF THE GAME, BUT YET STILL A RULE-.... And as we saw in the testcases along with the tutorial, when his sum of money reaches 0 while his losses in a row aren't past the limit yet.. the game ends... In a logical world.. Sasha will always win... cos... "any outcome that DOES NOT CONTRADICT the RULES described above" but the tutorial, the judging server, as well as the test cases proved differently.. I hope for less ambiguous statements in the future. edit: I read the problem after the contest and the adjustments were not yet added to the statement..

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

shinonome ena???

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

Почему в случае "3 3 6" ответ "Нет"? Может кто-то найдет ошибку в моей логике, но смотрите. Саша знает, что он может проиграть не более X раз подряд, стало быть он точно знает, что если он уже проиграл X раз подряд, то следующая ставка будет ТОЧНО выигрышной. Тогда давайте ставить 1 монетку всегда, кроме того случая, когда игра ТОЧНО выигрышная, будем обозначать П — проигрыш, а В — выигрыш. Рассмотрим 2 случая, когда Саша проиграл X подряд и X+1 раз будет точно выигрышным, и случай когда ТОЧНО выигрышных ситуаций нет. Пусть у нас идет последовательность ПППВ, мы проиграли 3 подряд, значит следующая игра выигрышная, значит Саша может ставить на нее все деньги. Как говорилось ранее, на игры которые не точно выигрышные мы ставим 1 монетку, тогда за 3 проигрыша мы потеряли 3 монетки, 6-3 = 3, тогда мы ставим 3 и выигрываем 6, в сумме имеем 9, то есть, мы ушли в плюс. Теперь рассмотрим ситуацию, когда точно выигрышных игр нет, тогда мы будем ставить всегда 1 монетку. Несложно заметить, что худший случай — ППВППВ.... Тогда перед каждой победой мы проигрываем 2 монетки, 6 — 2 = 4, имея 4 монетки мы ставим одну и выигрываем 2, итого мы имеем опять 6 монеток. В условии сказано, что Саша должен иметь возможность бесконечно не уходить в минус "Другими словами, правда ли, что для любого целого числа n , Саша сможет делать ставки так, чтобы при любых их результатах, не противоречащих описанным выше правилам, в какой-то момент времени у него было хотя бы n монет." В чем я не прав?

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

    Казино делает такую подставу: вместо ПППВ оно делает ППВ...

    $$$6 \rightarrow 5 \rightarrow 4$$$, два раза проигрываем, и тут случается подстава:

    $$$4 \rightarrow (4-1) + 1 \cdot k = 3 + k$$$ (победили)

    Если $$$k=3$$$ или $$$k=2$$$, то мы не уходим дальше $$$6$$$, следовательно, ходить по единицам в этом тесте проигрышная стратегия.

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

      Да, я это тоже описал в комменте, но мне уже объяснили в блоге, что я как оказалось неправильно понял условие, я думал, что надо не уходить в минус, а надо было строго в плюс, можешь почитать, если интересно

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

The system has suspected of me copying the code for problem C. I think it is because I have never solved C in div 2 before or whatever the reason may be. I was pretty close to solve C in the previous div 2 as well. Anyways here's proof I did not cheat

I had seen similar questions before, and knew it was a gambler's ruin problem https://youtu.be/Ne2lmAZI4-I?si=C6cn7-NH0nUfwroV Pretty popular video on the problem. Once that was known, I only had to check if I had the required amount of money to bring back my amount lost after every gamble. And the most I could lose was x no. Of times. So that's only what I've done. I don't know how it was similar to other people's code but it's only normal for them to write in Java with the same logic and very little scope of picking other variable names. And Gpt will write the same code for the command I have written above. It is that simple. I rest my case. I hope I am heard.

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

    Same exact situation for me, except I never saw a video about it. Incredibly frustrating.

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

Great problemset

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

Does rating will change after this contest ?

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

Ok, same problems. thank you, i'm still scared

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

I got my problem removed for rules violations despite the fact I did and do not share or receive solutions. This is where these solutions probably came from https://www.geeksforgeeks.org/count-sum-of-digits-in-numbers-from-1-to-n/.

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

wuw