pashka's blog

By pashka, history, 2 months ago, In English

Hello! On Feb/18/2024 15:05 (Moscow time) will start Codeforces Round 927 (Div. 3), the next Codeforces round for the third division.

The round is based on problems from JetBrains Academy Youth Challenge. If you participated in it, please don't participate in this round.

Problems for this round are prepared by denk, step_by_step, goncharovmike, ikrpprppp, pashka, Vladosiya and MikeMirzayanov.

Thank you very much awoo, BledDest, buyolitsez, EgorUlin, Gojova, GrandFruit, Hello_zoka, petyb, scanhex, senjougaharin, shnirelman, SomethingNew, Toy_mouse, Zandler for testing the round.

As usual for the third division rounds:

  • there will be 6-8 tasks in a round
  • round duration is 2 hours 15 minutes
  • the round follows the ICPC rules, penalty for an incorrect submission is 10 minutes
  • round is rated for participants with ratings up to 1600
  • after the round there will be a 12-hour open hacking phase

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

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

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

Good luck to all!

UPD: Editorial

  • Vote: I like it
  • +170
  • Vote: I do not like it

»
2 months ago, # |
  Vote: I like it -40 Vote: I do not like it

First

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Hoping for clear problem statement

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

such a great weekends!

»
2 months ago, # |
Rev. 6   Vote: I like it +3 Vote: I do not like it
 █████  ██      ██          ████████ ██   ██ ███████     ██████  ███████ ███████ ████████ 
██   ██ ██      ██             ██    ██   ██ ██          ██   ██ ██      ██         ██    
███████ ██      ██             ██    ███████ █████       ██████  █████   ███████    ██    
██   ██ ██      ██             ██    ██   ██ ██          ██   ██ ██           ██    ██    
██   ██ ███████ ███████        ██    ██   ██ ███████     ██████  ███████ ███████    ██    

All The Best (Zoom out if not visible)

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +2 Vote: I do not like it

    Did You meant to say " All the best???" not quiet easy to guess in desktop...

    Spoiler
»
2 months ago, # |
  Vote: I like it -13 Vote: I do not like it

"The round is based on problems from JetBrains Academy Youth Challenge. If you participated in it, please don't participate in this round." Does this mean if someone participated in that one ,they would have some advantage in this round?(wanted to clarify it)

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +2 Vote: I do not like it

    Does this mean if someone participated in that one ,they would have some advantage in this round?

    Yes, because the problems are the same? It's quite a big advantage if you have solved the exact same problems before

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    Can someone plz tell me why my comment got so many downvotes(genuinely want to know,to avoid/learn/improve)

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Trust me. Some people just downvote for fun. They don't want to clarify your doubts. But they feel annoyed thinking that you don't even know simple things. I hate these egoists.

»
2 months ago, # |
  Vote: I like it -8 Vote: I do not like it

What is the score distribution?

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    In ICPC rules, all problems are worth the same.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it -22 Vote: I do not like it

      So all are problems are rated 1000?

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it -8 Vote: I do not like it

        it's based on how many problems you wrote, if equal it's based on penalty

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        No, ICPC rules state that you are rated by # of problem solved, then time. There is no point system, however the questions themselves vary in difficulty (so better solve A first for a quick advantage)

»
2 months ago, # |
  Vote: I like it +15 Vote: I do not like it

Can the timing be changed? It clashes with ARC. Moreover, this time is quite awkward for me, as I have an important appointment at that time.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it -7 Vote: I do not like it

    Ohh why not sir. Please tell us when you're free and we'll change the timing according to your availability. Thank you.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Great that u understood. I prefer to have it on regular Cf time so that it doesn't coincide with Atcoder Regular Contest and people like me can go on with their regular Sunday Schedule.

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        We have a slot free on 30th Feb at regular CF time. Is that alright sir?

        • »
          »
          »
          »
          »
          2 months ago, # ^ |
          Rev. 2   Vote: I like it 0 Vote: I do not like it

          ,

          • »
            »
            »
            »
            »
            »
            2 months ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            This is your first comment, and you've said this? So sad.

            • »
              »
              »
              »
              »
              »
              »
              2 months ago, # ^ |
              Rev. 3   Vote: I like it 0 Vote: I do not like it

              ,

              • »
                »
                »
                »
                »
                »
                »
                »
                2 months ago, # ^ |
                  Vote: I like it 0 Vote: I do not like it

                What's your main?

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  2 months ago, # ^ |
                  Rev. 2   Vote: I like it 0 Vote: I do not like it

                  Cant say sorry. It seems to be your second account as well.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  2 months ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  You do believe that single-account policy exists here right?

                  For everyone else, don't be this guy. Stick with your accounts.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  2 months ago, # ^ |
                  Rev. 2   Vote: I like it 0 Vote: I do not like it

                  ,

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  2 months ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  At least they aren't your level of dumb, literally saying out loud like that. Keep it to yourself mate.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  2 months ago, # ^ |
                  Rev. 2   Vote: I like it 0 Vote: I do not like it

                  ,

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  2 months ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  wow, very tough. Wasn't you the guy who said eren to fk off and not do cp because, and quote, "dont try to mess with the tough ones kid"? mind YOUR own business first, then talk to me.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  2 months ago, # ^ |
                  Rev. 2   Vote: I like it 0 Vote: I do not like it

                  i have more than two ids that is not something you should be talking about..i was just saying him not to mock someone...you wont get that so .just go away instead of arguing

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  2 months ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  I don't see any mocking done here, more like a joke. But you're right, maybe i should stop arguing and get some problems in. Have fun with your alternative accounts then

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  2 months ago, # ^ |
                  Rev. 2   Vote: I like it 0 Vote: I do not like it

                  So glad u understood...yeah i should be going and solve some problems as well..see ya later..best of luck with your journey mate..

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  2 months ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  And also sorry for those harsh words..i get your point..see ya

  • »
    »
    2 months ago, # ^ |
      Vote: I like it -8 Vote: I do not like it

    Oh yes lets change the contest date because Six_Seconds has an appointment at that time.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it +15 Vote: I do not like it

      2 of the biggest cp sites should try not to put contests at the same time....especially when one of them has been scheduled for weeks. (Note : leetcode does not count as cp)

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Yes but I was just joking about the fact that he said he has an appointment like that makes it more reasonable to cancel the contest.

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it +5 Vote: I do not like it

        However tourist can still ak both of the 2 contests. That's awful.

»
2 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Hey boy, are you a semicolon? Because my program is missing you ;)

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

as not a tester i would like to solve this round

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Finally after a tedious global round which took away my *1800 it's time to relax. Hope to solve A-F

»
2 months ago, # |
Rev. 2   Vote: I like it +2 Vote: I do not like it

This comment has been deleted.

»
2 months ago, # |
  Vote: I like it +1 Vote: I do not like it

Good start time for Chinese.

But I must finish my winter vacation homework!!!F**k

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You can say more about it and I will be happy because I have already entered university and I have no homework this winter vacation. LOL

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Back-to-Back codeforces contest. really amazing. Beast of luck everyone. ヽ(•‿•)ノ

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I have a feeling this round will be amazing.

»
2 months ago, # |
  Vote: I like it -10 Vote: I do not like it

If problems are already based on jetbrains youth academic challenge, then it means people already know the problems. Not just that, we can find them from internet also.

Therefore, let's not participate in this round.

»
2 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it


»
2 months ago, # |
  Vote: I like it +1 Vote: I do not like it

problems of this contest are prepared "step_by_step"

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

My 1st unrated Div 3 !(;

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I would target solving >75% problems.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Good start time!

»
2 months ago, # |
  Vote: I like it +1 Vote: I do not like it

Yesterday i became specialist so i hope to reach expert again.

  • »
    »
    2 months ago, # ^ |
    Rev. 2   Vote: I like it +1 Vote: I do not like it

    I also became a specialist yesterday and I hope not to become a pupil again

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I know i will get -ve point in this contest :(

»
2 months ago, # |
  Vote: I like it +1 Vote: I do not like it

Please note the unusual start time: 18:05 UTC+6

»
2 months ago, # |
  Vote: I like it +1 Vote: I do not like it

The timing is great, but it overlaps with ARC's timing.

»
2 months ago, # |
  Vote: I like it +1 Vote: I do not like it

Good lucks for everyone!

»
2 months ago, # |
  Vote: I like it +1 Vote: I do not like it

Good luck to all of my grey friends :D

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Redemption time

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

extra registration ??

»
2 months ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

.

»
2 months ago, # |
  Vote: I like it -12 Vote: I do not like it

c Problem is very tough :(

»
2 months ago, # |
  Vote: I like it +34 Vote: I do not like it

tourist speedrun the division 3 in 28 minutes to clinch first position,then started Atcoder regular contest 45 minutes late and still came 3rd(Standings ). GOAT stuff.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Tourist teaching nubs how it is done just like Dr Disrespect.

»
2 months ago, # |
  Vote: I like it +2 Vote: I do not like it

I got PTSD because of Problem C

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yup, I think I could've done both D and E but just wouldn't give up C because I thought I was going crazy and missing something way too obvious.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Yeah I kept trying to do modular inverse, but realized that only works for certain m.

      The observation is to figure out the last value before performing the last operation, then simulate the process backward and compute the cur value with modular multiplication.

      My solution is here if it helps: 247081220

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      yes , i was not able to solve c , i decided to skip c , and i solved d and e both in contest.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    hint: reverse LR string

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Can you please elaborate?

      • »
        »
        »
        »
        2 months ago, # ^ |
        Rev. 3   Vote: I like it +1 Vote: I do not like it
        • calculate where will be left and right indexes after all operations
        • reverse LR string
        • calculate values (left moves to the left, right to the right)
        • reverse result array and print

        https://codeforces.com/contest/1932/submission/247073793

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Same thing, but maybe more intuitive because doesn't require to calculate starting point is to collect the order of indices (kind of topological sorting), and multiply them backwards.

        Code

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Man, i solved C, but couldn't understand b, even after reading it 10 times

»
2 months ago, # |
  Vote: I like it +2 Vote: I do not like it

Ugh, I feel so dumb for not being able to figure out C

»
2 months ago, # |
  Vote: I like it +25 Vote: I do not like it

Silent moment for ones who tried so hard for bigint in E

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It was actually pretty easy, and I , of course, didn't think about the optimized solution during the contest. just AC it this morning

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Was F dp + segment trees?

»
2 months ago, # |
  Vote: I like it +8 Vote: I do not like it

when will i can see the editorial ??

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

how to solve the E?

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    For example S = "12345", then the answer is 1 + 12 + 123 + 1234 + 12345 (hope you can find out why it is)

  • »
    »
    2 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    A key observation is decreasing 10->0 takes 11 seconds, 100->0 takes 111 seconds...

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I did see that, but I didn't know how to implement it.

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Think about count 1s for each position. Then add them up.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    According to the statement, going from 10 -> 0 requires time = 11. going from 20 -> 0 requires time = 22. ... going from 100 to 0 requires time = 111. going from 200 to 0 requires time = 222.

    Say you are given string S = 12345 First you make 2345 -> 0 (A) then you go from 10000 -> 0 which requires 11111 time. (B) A+B is the ans.

    Let's make 2345 -> 0. First you make 345 -> 0, (A) and then you go from 2000 -> 0 which requires 2222 time. (B) A+B is the ans. and so on.

    Thus we can observe each i will be the sum of the prefix digits upto i.

»
2 months ago, # |
  Vote: I like it +1 Vote: I do not like it

E and D are just implementation didn't like them that much.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

went good for a first div3 unrated contest

»
2 months ago, # |
  Vote: I like it +1 Vote: I do not like it

How this code not able to pass C ? link anyway i solve it using Segment Tree link

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I can't figure out why this code fails for C: 247057083

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    Maybe a long long overflow when calculating the product at the beginning.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    Every value of A(i) can go upto 1e4. Now imagine 1e4 values in all the n elements... It will be (1e4)^n and as n can itself go upto 2e5.

    So, (1000)^(20005). Do you think It can be stored?

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I am stupid

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        So am I. Took me ages to figure it out. I literally remember same kind of mistake in My First ICPC in 2022.

        Repeating same mistake twice proves me more stupid.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      OMG, I thought 1e4 * 2e5 at first,so it will not long long overflow

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    This line is definitely the problem:

    for(int i = 1; i <=n; i++){
        prefArr[i]=prefArr[i-1]*nums[i-1];
    }
    

    Because you could end up with a number as big as $$$10^{8 * 10^{5}}$$$ which just can't fit into a 64 bit integer.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Nowadays Div 3 is harder than Div 2. I don't know if it is only for me or if other users also feel it. BTW happy coding...........

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

there was no where written about score penalty for wrong submissions? Why penalty has been made?

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Sounds like a bug. I get a score bonus for wrong submissions.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    "the round follows the ICPC rules, penalty for an incorrect submission is 10 minutes"

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      its written about time penalty only, does it also mean score penalty while calculation of rank?

      • »
        »
        »
        »
        2 months ago, # ^ |
        Rev. 2   Vote: I like it 0 Vote: I do not like it

        time penalty doesn't mean it is gonna remove 10mins of your solving time but it is gonna add 10mins to your solution time (the penalty is time you took to solve problem + 10mins(for every incorrect submissions)).

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

E got TLE with python but in c++ with making bignum get AC.

»
2 months ago, # |
  Vote: I like it +1 Vote: I do not like it

Problem F was really nice. Thanks authors. :blobheart:

»
2 months ago, # |
  Vote: I like it -23 Vote: I do not like it

what the fuck is b and c

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I had to derive the question by looking at sample test cases.

    Such bad problem statements this time.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

problem C was quite pleasure to solve

I felt like being Elegia

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

How to solve C?

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I used segment Trees to find product of a range % modulo

  • »
    »
    2 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    Just do it in reverse order, then you will multiply instead of dividing the current number.

    Also, I've seen your code. If you tried to divide the current number, but in modulo form, you need to use modulo reverse rather than divide it directly

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    solve from the back

»
2 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Am I the only one who is able to solve C but could not solve any other problem.

what is wrong with me... :(

could anyone tell what is wrong in :

Problem B submission

Problem A submission

EDIT: I found the small bugs in my code both above submissions are incorrect

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    for A i use recursive it's kinda similair to minimum jump problem code

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    For problem A: you will not be able to move further after two consecutive thorns cells. The answer to the problem will be the number of coins up to two consecutive cells with thorns

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I didn't clearly understand your solution but let me tell you my logic

    Problem A: simply start from left & collect every coin and it any point you encounter two consecutive * (thorns) exit your loop.

    Problem B: let A be the year of ith apocalypse, then simply check for the (i+1)th apocalypse if its year is greater then A simply change A = that year, if it is <= a then find the next multiple of that element greater A.

    here are my solutions for reference

    https://codeforces.com/contest/1932/submission/246993142 — Problem A

    https://codeforces.com/contest/1932/submission/247002028 — Problem B

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    For problem B you can linearly find the multiplier x(i+1) for which ai < a(i+1) * x(i+1)

    If you keep doing this for every i, the last element of the array is your answer.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

hi guys what means "Exit code is -1073740940"? what should i do with it?

»
2 months ago, # |
  Vote: I like it +13 Vote: I do not like it

Is G just Dijkstra's but edge weights are computed using some x such that a + bx = c + dx, if the two sides of the equation are 2 different platforms?

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I recorded myself live while solving it. I solved A,B,C and D problem. Hope it helps someone: https://www.youtube.com/watch?v=7Sv_tmVLQeQ

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Is there a more effective way to do D other than making an if-else chain?

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    backtracking

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Hmm, I guess that's one way, didn't click for me

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      No, you can't. Each card can have 32 positions. I wasted 2 hours trying to implement it.

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Check my submitted solution it is using backtracking

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I imagine you could create a custom comparator and then sort, correct me if I am wrong.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I did the following. I keep the sorted values of the cards for each suit. For the non-winning suits, I can just have the cards beat each other in sorted order, taking 2 at a time until I have 0 or 1 left. If I have 1 left, I'll save it for later. Then afterwards I can just take the winning suit, eliminate all of the remaining ones from other suits, and eliminate the rest in the winning suit the same way as before.

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I see, I believe I did something similar as well. Just couldn't simplify the conditionals effectively, so it almost comes off like a shabby brute-force.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Store in map

  • »
    »
    2 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    Sort card for each suit and greedily remove 2 cards at a time, if there is one card left, u need to match it with any trump. At last u do the same thing for the rest of the trump cards.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Group each card by suits. Then sort by rank for each suits

    Now for each suit other than the trump, take two adjacent card rank. If there are some excesses, keep it and use the trump to beat them

    Now use the remaining trump suit to battle each other

    The impossible case is only when the excesses are greater than the trump suit

  • »
    »
    2 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    I used this comparator function to sort all the cards

    bool comp(string a, string b) {
        // Both are trump
        if (a[1] == trump && b[1] == trump) {
            return a[0] < b[0];
        }
    
        // One is trump
        if (a[1] == trump) {
            return false;
        }
        if (b[1] == trump) {
            return true;
        }
    
        // Both are normal, same suit
        if (a[1] == b[1]) {
            return a[0] < b[0];
        }
    
        // Both are normal, different suit
        return a[1] < b[1];
    }
    

    Then my logic for the ans is just go from left to right

    • If there are still 2 cards of the same suit -> Choose them
    • If there is only 1 card left of that suit then get a trump card from the back (If I still has trump cards)
    • Otherwise, I can't beat the current card -> This game is impossible
        vector<pair<string, string>> ans;
        int rightIdx = 2 * n - 1;
        bool ok = true;
        for (int i = 0; i + 1 <= rightIdx; i++) {
            if (a[i + 1][1] == a[i][1]) {
                ans.push_back({a[i], a[i + 1]});
                i++;
            }
            else if (a[rightIdx][1] == trump) {
                ans.push_back({a[i], a[rightIdx]});
                rightIdx--;
            }
            else {
                ok = false;
                break;
            }
        }
    
  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    you can refer my solution Problem D

»
2 months ago, # |
  Vote: I like it +4 Vote: I do not like it

Spent a long time to understand what problem B wants

You too?

  • »
    »
    2 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    +1

    i spent about 40 minutes trying to figure out what's required and solved it in like 5 minutes

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Same, I couldn't comprehend what problem B meant spent 40mins there and wasn't able to solve and then when I went to C, D, E all made sense. For problem E solution for python gave TLE, and by the time I wrote the code in C lang time was up. So frustrating could have possibly solved all 5...

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yup me too, got to know by looking at the sample test cases. Poor writing of the problem statement.

»
2 months ago, # |
  Vote: I like it +14 Vote: I do not like it

Ac F at 2:14 i can't believe myself

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

A lot of people are cheating . Codeforces please look into this matter. People are uploading their solution on youtube and telegram also. How it is possible that people submited solution of three problem in a gap of three minutes and also in different language while in contest and even after 1 hour suddenly they submit their solution

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

If you need video explanations of C, D, E and F, you can check my video editorials here

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Why long long doesn't work for problem C. Calculating the product in long long then dividing the product by left or right whatever element is deleted?

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Because long long will overflow

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I accept, I am dumb. Don't know why but thinking it as 1e5 * 1e4 which is (1e4+1e4+1e4+......(1e5 times)). But it is actually (1e4*1e4*1e4....(1e5 times) which will cause overflow.

  • »
    »
    2 months ago, # ^ |
    Rev. 2   Vote: I like it +1 Vote: I do not like it

    it's long long overflow, a[i] can be 1e4, and n can be 2e5 imagine array all the elements are 1e4 of length 2e5 so the product all of them is (1e4)^(2e5) that can't fit in long long

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Because there is a test case which $$$n=2\cdot10^5$$$ and all $$$a[i]$$$ are $$$10^4$$$, then it will be $$$10000^{200000}$$$ :)

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

BE CAREFUL OF CARD SIMULATIONS 23min D, 7min E

I did F with linear DP, first finding out bar[x] = which spot is the leftmost viable spot on x's right if x is chosen.

Could someone explain how G works?

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Can somebody tell me why deque can't solve problem c??? I can't pass test 3.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it
    p *= a[i]
    
    

    gonna make integer overflow


    if (s[i] == 'L') { p /= a.front(); a.pop_front(); } else { p /= a.back(); a.pop_back(); }

    Is not accurate, because you need to use modulo inverse, although I think it is not usable in this problem (because m isn't a prime number sometimes)

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Maybe i misunderstood the problem? The problem let us get the product of the current array elements,then the let product mod m, lastly remove one element。

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      247159936 can you have a look at this one too ,it fails on TC2 , I tried modding it with 1e9+7 because my earlier submission failed on TC3.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Whats wrong with the naive implementation of problem C?

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    probably because of overflow

  • »
    »
    2 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    If you have $$$2\cdot 10^5$$$ elements and all of them are $$$10^4$$$, your product will be $$$(10^4)^{2\cdot 10^5}$$$ so it overflows.

»
2 months ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

D can be solved by using Blossom algorithm, even though it is just an overkill of the problem

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Must we use Blossom? I believed the graph wouldn't contain a cycle and is thus bipartite, so I tried to find the matching with max flow. However, I failed on test 3.

    • »
      »
      »
      2 months ago, # ^ |
      Rev. 3   Vote: I like it 0 Vote: I do not like it

      I suppose that it can be solved using max_flow algorithms, but max matching is more intuitive, i think

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

why greedy does not work for F? :(

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    how you suppose to do it greedily?

    • »
      »
      »
      2 months ago, # ^ |
      Rev. 3   Vote: I like it 0 Vote: I do not like it
      1. sort according to the left points
      2. put those intervals into lists of non-overlapping intervals, like this:

      2 4, 5 7, 10 11

      2 6, 7 7

      4 5

      1. in each iteration, I'll increment the answer by the number of overlapping intervals in the first element of the lists (a little bit confusing description :(, those intervals will form a larger interval (called concatenated intervals) and also removes all intervals contained in the concatenated interval. Then remove empty lists.
      2. output the answer
»
2 months ago, # |
  Vote: I like it +2 Vote: I do not like it

C problem is really hard for Div3 XD.

p.s Who solved this problem without trees? :)

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I'm curious about the segment tree solution, can you explain a little bit?

    • »
      »
      »
      2 months ago, # ^ |
      Rev. 3   Vote: I like it 0 Vote: I do not like it

      Very simple problem if you think using segment tree.find my solution here..

      C++ Code
  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It’s pretty simple just compute if offline in reverse order. Start from index after n-1 operations. This index is both l and r. in reverse order, if operation is R, append the righter value and increment.

    • »
      »
      »
      2 months ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      yes very simple if you know how to solve it. not so simple if you dont.

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        basically the reverse approach is hard to think of but it is not the only one you can use segtree and just recompute again for every range thanks to segtree this will be done in n log n instead of n^2

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I solved it with sqrt decomposition

  • »
    »
    2 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    I had no idea that trees could be used to solve this problem :(

    I got it wrong when using a brute force method initially as I got a TLE since I was calculating the product again and again for each command giving somewhat O(n^2) solution

    Also I realized it was not possible to calculate product just once and remove the contribution of boundary elements in each command...

    then it hit me that I could probably start in the reverse order! start from the last element that would be left after all commands and then move reverse in the commands string and keep including the new element in the answer... (Basically not moving from n elements to 0 elements but instead moving from 0 elements to n elements) This way I could do it in O(n) by visiting each element just once. This would give us the answer vector in the reverse order and then I just print it in reverse to get the final correct answer!

    https://codeforces.com/contest/1932/submission/247080815

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Start from reverse. Start from one element that is going to be remaining at last, after removing every other. Then keep multiplying second last, third last… while taking modulo. And then print array of answers in reverse

»
2 months ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

when you realize taking input in int and str matters just after the contest!-_-

TLE submission

AC submission-_-

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

One MODULO can make all the difference WoW!! (Problem C btw)

Without % -> This
With % -> This

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I came at the regular contests time and open the contest very seriously and solved the first problem and before starting the second one I looked to see how much time I spend on it, and yeah it was finished :(

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Finally I've recovered my -153 rating drop from Good Bye 2023 in this contest.

»
2 months ago, # |
  Vote: I like it +2 Vote: I do not like it

I loved Problem E,Great contest

»
2 months ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

very good D and E problem,makes my rating down down down.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

フーヤをもらえますか

»
2 months ago, # |
Rev. 2   Vote: I like it +16 Vote: I do not like it

Nice contest! Anyway here is my solution for problem F :
Let call cover[i] means the number of segment that cover point i. We can find this by using a multiset.

Iterate from 1 to n. Let's call dp[i] : Consider to position i, what is the maximum answer can we make

  • If we did not choose a point on i : dp[i] = dp[i-1]
  • If we did choose a point on i : dp[i] = dp[j] + cover[i] with condition : i and j does not lied in any same segments.
  • Here's how to find j. For all segments that contain point i, let's call L is the minimum left border of all segments. It's obvious that j = L — 1.

Hope it make sense!

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Problems E & F were great! Nice contest! I enjoyed it!

»
2 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Why is this impossible in problem D ?

1
S
7S 3S

Since both belong to trump suit, and 7S has a higher rank, it can beat 3S. ??

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

can someone explain problem B. Chaya Calendar

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    This is the first case: 6 3 2 4 5 9 18 So the first sign occurs every 3 years, so the first time it occurs is in the third year. The second sign occurs every 2 years (2, 4, 6, 8... ), as signs must occur sequentially, the second sign will occur in the 4th year (the 2nd year also occured but the first sign didn't). So the ans will be like ans = 0 for freq in a: ans = ((ans/freq) + 1) * freq Doing this, you assure a year where all the ith signs have occured

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Did anyone use DP to solve E? I usually don't use Python and thus had TLE at case 6. Submission

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

qué rico contest // nice contest

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Is there a penalty for unsuccessful hacking attempts?

»
2 months ago, # |
  Vote: I like it +8 Vote: I do not like it

How to solve Problem G?

  • »
    »
    2 months ago, # ^ |
    Rev. 4   Vote: I like it +25 Vote: I do not like it

    Here is my solution:

    For each passages, find the times in which the levels of the connected platforms are the same. To do so, you need to solve the equation:

    $$$\begin{alignat*}{2} && l_u + t \cdot s_u &\equiv l_v + t \cdot s_v \quad&(\text{mod } H)\\ &\implies& t \cdot(s_u - s_v) &\equiv l_v - l_u &(\text{mod } H)\\ &\implies& t \cdot(s_u - s_v) + k \cdot H &\equiv l_v - l_u &\text{for some } k \in \mathbb{Z} \end{alignat*}$$$

    You can solve this equation using the extended Euclidean algorithm. Define $$$C = \frac{l_v - l_u}{\gcd(s_u - s_v, H)}$$$. Note that if $$$t_0$$$ is one solution, then $$$t_0 \pm C$$$ is also a solution.

    So, for each passage, you know you can cross it if and only if $$$t \equiv t_0 \left(\text{mod } C\right)$$$.

    Then, you can solve the rest of the problem using a simple modified Dijkstra algorithm, where when crossing a passage you update the new distance as $$$t_0 + C \cdot max\left(0, \left\lceil\frac{t_0 - curdist}{C}\right\rceil\right) + 1$$$.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Can you please explain this, we can find t using the extended euclidean algorithm but how will we get the smallest t ?

      • »
        »
        »
        »
        2 months ago, # ^ |
        Rev. 2   Vote: I like it +8 Vote: I do not like it

        If $$$d = gcd(a, b)$$$ and $$$(x_0, y_0)$$$ is a solution to $$$ax + by = d$$$, then the general solution to $$$ax + by = dj$$$ is:

        $$$\left\{\left(x_0j + \frac{b}{d}k, \, y_0j - \frac{a}{d}k\right)\mid k \in \mathbb{Z}\right\}$$$

        Thus, the solution with the smallest value of $$$x$$$ would be $$$\left(x_0j \text{ mod } \frac{b}{d}\right)$$$.

        • »
          »
          »
          »
          »
          2 months ago, # ^ |
            Vote: I like it +5 Vote: I do not like it

          why is it x0j + (b/d)k and not x0j + bk, this will also keep the equation balanced, x0j + bk and y0j — ak

          I am sorry I looked at many resources but no one explains this if you could please explain it

          • »
            »
            »
            »
            »
            »
            2 months ago, # ^ |
              Vote: I like it +1 Vote: I do not like it

            Honestly, I just memorized that as a fact without giving it much thought. However, if I have to try to justify it, it would go like this:

            If we substitute $$$\left(x_0j + \frac{b}{d}k, \, y_0j - \frac{a}{d}k\right)$$$ in the the equation $$$ax + by = dj$$$, we have:

            $$$ \begin{alignat*}{2} &&a\left(x_0j + \frac{b}{d}k\right) + b\left(y_0j - \frac{a}{d}k\right) &= dj \\ &\iff& ax_0j + \frac{ab}{d}k + by_0j - \frac{ab}{d}k &= dj \\ &\iff& ax_0j + by_0j &= dj \\ \end{alignat*} $$$

            As for why we choose $$$\frac{b}{d}$$$ and $$$\frac{a}{d}$$$, it is becuase they are the smallest integers which can cancel each other out as above.

            For example, note that $$$x_0j + bk$$$ also gives us a set of valid answers. However, they don't give us the full set of answers. More formally:

            $$$\left\{\left(x_0j + bk, \, y_0j - ak\right)\mid k \in \mathbb{Z}\right\} \subseteq \left\{\left(x_0j + \frac{b}{d}k, \, y_0j - \frac{a}{d}k\right)\mid k \in \mathbb{Z}\right\}$$$
            • »
              »
              »
              »
              »
              »
              »
              2 months ago, # ^ |
                Vote: I like it +5 Vote: I do not like it

              Thankyou so much,this was just basic LCM calculation,i completely understood this now

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Can O(NlogN) solution of problem C be hacked?

»
2 months ago, # |
  Vote: I like it -6 Vote: I do not like it

tourist used dp just to solve a Div3A lol 246990951

»
2 months ago, # |
  Vote: I like it +2 Vote: I do not like it

B getting hacked like potatoes!!

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    do you know why ?

    • »
      »
      »
      2 months ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      If you try "brute force", by multiplying ai by 1,2,3... until big enough, you will TLE, for example if a1=1e6, and a2...a100 = 2, t=1000

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Dunno about you all but this is imo very confusing descrption:

description

Why use words sequentially? Why use "strictly after". If there werre not example input/output I would think that you have to find years p, p+1, p+2, ..., p+n such that first sign happens on p, second sign happens on p+1 and so on.

»
2 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

I tried solving C by calculating product of the range left after each operation using sqrt decomposition (247032959). It was giving TLE. Is there something wrong in implementation ? Because a same problem with similar constraints (243011064) got AC. I know it's not a good approach. It could be solved much simply but that's the approach I thought in contest.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

What was B, why was B, didn't understood it from question and explanation :(

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

If I have submitted 2 accepted solutions in Div 3. Will the later one be considered as my final solution and analyzed in system testing???

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Why is B getting hacked?

  • »
    »
    2 months ago, # ^ |
    Rev. 2   Vote: I like it +3 Vote: I do not like it

    1000000 1 1000000 1 1000000 1... causes tl for solutions that try to linear search next year every time

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

one of the best div 3s ever

thanks a lot

»
2 months ago, # |
  Vote: I like it +1 Vote: I do not like it

HackForces

»
2 months ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

I solved problem C with segment tree and problem E with lazy propogation.There's has easy solution,but yesterday my brain stopped, silly me.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I'm joker.I directly used segment tree to solve C……

»
2 months ago, # |
  Vote: I like it +8 Vote: I do not like it

Editorial when?

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Was this round not rated? I did not recieve any rating

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It is rated. Will take some time for the ratings to be updated.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

MikeMirzayanov I have an optimization for system testing. Instead of testing on whole set of test cases again, test just on new test cases because anyway the submissions which are being tested have passed the pretests. This can potentially speed up system testing.

»
2 months ago, # |
  Vote: I like it +1 Vote: I do not like it

Getting the system test done is like waiting for a snail to finish a marathon!

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

A testcase for A question has been missed in the system testing as well. The case is when the staring point is a goldcoin.Many users dint write the code to cover this edge case.Please look into it.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Starting or the ending point?

    • »
      »
      »
      2 months ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      starting (the first cell)

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it +6 Vote: I do not like it

        It is guaranteed that the first cell is empty.

        Lesson: Read the input section clearly & completely.

        • »
          »
          »
          »
          »
          2 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          Ohhhh My bad, Leaving the comment here so that other people will get to know.

        • »
          »
          »
          »
          »
          2 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          Bro your heatmap !! orz...

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Why "My submissions" is showing empty when i solved 2 problems yesterday and its showing my my rank in standings but not showing my submissions and contest also not showing in my contest area?

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

When will the rating update?

»
2 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

I solved problem B and It got AC in the contest time. But after system testing it got TLE!! If it says tle in the contest time then I should debug that. But Now this will cause a lot of rating loss.

Very Disappointing

I participated in a virtual contest and didn't know that virtual was unrated. Thank you rahulsingh28082000

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You solved B in virtual contest. How do you expect it to affect your rating ?

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Thank you for your reply. I didn't know that virtual is unrated

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

wo

»
2 months ago, # |
  Vote: I like it +9 Vote: I do not like it

Anyone knows when Editorial will be out?

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Why does this C++ segment tree for problem C get a TLE? https://codeforces.com/contest/1932/submission/247091172

The code copied here:

void build(vector<int> a, int v, int tl, int tr, int m, vector<int> &t) {
    int n = a.size();
    if (tl == tr) {
        t[v] = a[tl];
    } else {
        int tm = (tl + tr) / 2;
        build(a, v*2, tl, tm, m, t);
        build(a, v*2+1, tm+1, tr, m, t);
        t[v] = (t[v*2] * t[v*2+1]) % m;
        }
}
 
int product(int v, int tl, int tr, int l, int r, const vector<int> &t, int m) {
    if (l > r) 
        return 1;
    if (l == tl && r == tr) {
        return t[v] % m;
    }
    int tm = (tl + tr) / 2;
    return (product(v*2, tl, tm, l, min(r, tm), t, m)
           * product(v*2+1, tm+1, tr, max(l, tm+1), r, t, m)) % m;
}
 
void solve(){
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    for (int i = 0; i < n; i++){
        cin >> a[i];
    }
    string s;
    cin >> s;
 
    vector<int> t(4*n, 1);
    build(a, 1, 0, n-1, m, t);
    int low = 0;
    int high = n-1;
 
    for (auto c : s){
        cout << product(1, 0, n-1, low, high, t, m) << " ";
        if (c == 'L'){
            low++;
        } else {
            high--;
        }
    }
    cout << endl;
}
 
  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You should pass vector through pointer in the build function. That is, replace the following:

    void build(vector<int> a, int v, int tl, int tr, int m, vector<int> &t)
    

    with:

    void build(vector<int> &a, int v, int tl, int tr, int m, vector<int> &t)
    
»
2 months ago, # |
  Vote: I like it +17 Vote: I do not like it

when's the editorial come out?

»
2 months ago, # |
  Vote: I like it +9 Vote: I do not like it

When is editorial?

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Those of you from the US probably know that paragraph 3 of Card Game is pretty political...

»
2 months ago, # |
  Vote: I like it +3 Vote: I do not like it

When will the editorial be posted

»
2 months ago, # |
Rev. 3   Vote: I like it +17 Vote: I do not like it

pashka MikeMirzayanov Publish the editorial Bro.

»
2 months ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

excuse me, but can someone take a look at my solution for D? 247482543

Edit
»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Where can I get solutions of this round??

  • »
    »
    2 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    It haven’t been posted now(though it should have been posted), you can view other’s submission instead.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Hello I think this has been a mistake:

Attention!

Your solution 247092052 for the problem 1932F significantly coincides with solutions Bobsy_is_back/247078909, bdyby10101/247085106, nohellodotcom/247085167, Sahilamin219/247086160, soumyadipdasmahapatra664/247086213, orazalyy/247087989, siddhantbhardwaj234/247088775, lender/247088979, nishkarsh1215/247089048, naked_soul/247091483, 3mk_leader/247091900, _Fer3on_/247092036, bgopc/247092052, orzdevinwangg/247092115, AkshitSharma/247092541, AJ_25/247092808, Ari10/247093633, JOO_91/247095387. Such a coincidence is a clear rules violation. Note that unintentional leakage is also a violation. For example, do not use ideone.com with the default settings (public access to your code). If you have conclusive evidence that a coincidence has occurred due to the use of a common source published before the competition, write a comment to post about the round with all the details. More information can be found at http://codeforces.com/blog/entry/8790. Such violation of the rules may be the reason for blocking your account or other penalties. In case of repeated violations, your account may be blocked.

That contest was unrated for me and I didn't even got in the contest in the start time and I didn't even care? why would I cheat when it's unrated? and the codes aren't even alike like WHAT?? The algorithm looks alike I agree but the code doesn't like why would I even cheat in an unrated contest???

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Sorry !!

    Correct me please, Are you talking about anything I did? that solution you mentioned I am not even aware of the question!!

    if I have misunderstood please let me know, I am sorry for my wrong understanding then!

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      no

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Thank you for your quick clarification!!

        I am highly dedicated to our codeforces rules.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Idk, why would you cheat in the unrated contest?

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I haven't that's the reason I'm appealing

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Dude I asked you why, not if you did it

        • »
          »
          »
          »
          »
          2 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          I didn't bro, there doesn't exist a reason for a thing that hasn't happened

          • »
            »
            »
            »
            »
            »
            2 months ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            Bro, again, I didn't ask you to explain cause-and-effect relationship, I asked why you'd cheated in the contest

            • »
              »
              »
              »
              »
              »
              »
              2 months ago, #