SlavicG's blog

By SlavicG, history, 20 months ago, In English

Hello Codeforces!

flamestorm, mesanu and I want to invite you to Codeforces Round 964 (Div. 4).

It starts on 06.08.2024 17:35 (Московское время).

The format of the event will be identical to Div. 3 rounds:

  • 5-8 tasks;
  • ICPC rules with a penalty of 10 minutes for an incorrect submission;
  • 12-hour phase of open hacks after the end of the round (hacks do not give additional points)
  • after the end of the open hacking phase, all solutions will be tested on the updated set of tests, and the ratings recalculated
  • by default, only "trusted" participants are shown in the results table (but the rating will be recalculated for all with initial ratings less than 1400 or you are an unrated participant/newcomer).

Additionally, there might be problems that are interactive, so please read the guide of interactive problems before the contest.

We urge participants whose rating is 1400+ not to register new accounts for the purpose of narcissism but to take part unofficially. Please do not spoil the contest for the official participants.

Only trusted participants of the fourth division will be included in the official standings table. This is a forced measure for combating unsporting behaviour. To qualify as a trusted participant of the fourth 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 1400 or higher in the rating.

Regardless of whether you are a trusted participant of the fourth division or not, if your rating is less than 1400 (or you are a newcomer/unrated), then the round will be rated for you.

Many thanks to the testers: Dominater069, Qualified, Vladosiya, qwexd, Gheal, cry, haochenkang.

We suggest reading all of the problems and hope you will find them interesting!

Good Luck!

UPD: Editorial is out!

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

| Write comment?
»
20 months ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

nice round

»
20 months ago, hide # |
 
Vote: I like it +31 Vote: I do not like it

Let's see how many 1400+ rated coders will make a new account.

»
20 months ago, hide # |
 
Vote: I like it +21 Vote: I do not like it

this will be a great round

»
20 months ago, hide # |
 
Vote: I like it +37 Vote: I do not like it

as a tester, i didn't set anything

  • »
    »
    20 months ago, hide # ^ |
     
    Vote: I like it -16 Vote: I do not like it

    hey, im new (2nd contest) so kindly help me out, i solved 4 out of 8 questions, my rating didnt increase yet. Does it take time or is there some other problem. My rating is 380 currently(less than 1400).

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

      As it is explained in the announcement, after the round there is 12 hours long hacking phase, where participants can hack each other's solutions. After that, all solutions will be checked one more time, so rating changes will be visible in about 16-18 hours.

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

        it has been more than 24 hours now, still the rating has not reflected on my account yet. What about you guys?

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

          After the contest there is 12 hours of hacking. After hacking there is system testing (currently been running for > 12 hours now).

          Seems like system testing should finish in the next 1-2 hours, after that they need to calculate rating updates. So rating should be updated in the next 12-24 hours.

»
20 months ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

Participating unofficially :D Have fun yall

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

first time i participate in a round unofficially, good luck everyone

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

    I understand that feeling! :3 Good luck, m8! Don't listen to haters.

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

purpose of narcissism, lol

»
20 months ago, hide # |
 
Vote: I like it +52 Vote: I do not like it

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

Hope to reach expert after this

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

My first round, wooh hooh!!

Btw this is 1400 point round, so can I earn max of 4200 point in 3 games and surpass tourist ?! /j

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

    That's not how it works

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

    That’s not how it works man

  • »
    »
    20 months ago, hide # ^ |
     
    Vote: I like it -6 Vote: I do not like it

    Seems like it won't be rated round for you... You need a history of 5 rated rounds already. Paradoxical, but that's how cf works. Compete in 5 div 2 rounds or smth, but first — good luck on this one!

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

      Read the bold line, it is rated for him. There is no sense in making contests (especially Div 4, meant for newbies) unrated becuase they have not participated in any rated contests xD

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

        Got it. That's actually good to know!!! Since I have friends that have 0 to 3 rated rounds in their history...

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

      It is rated for him, the point is that his performance in this round will not affect rating of the other Div. 4 contenders since he won't be on the official placement. This is made for smurfs in newreg accounts to not ruin fair Div.4 contenders' rating

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

Hope to reach 955 rating after this.

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

hope to reach 669 after this

»
20 months ago, hide # |
 
Vote: I like it -7 Vote: I do not like it

GL everyone, hoping to reach Expert after next contest

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

Thank you for everyone's effort to hold this contest. Let's go!!

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

I will be playing Titled tuesday tomorrow, Sorry, I won't be able to participate this time. flamestorm mesanu

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

Is there any DIv.5 on codefroces ?

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

My second contest... HUrrrrraayyyyyyyyy!!!!!

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

Good Luck Everyone! (Hoping to reach newbie after this)

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

is it rated?

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

Hope to reach candidate grandmaster after this contest.

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

how many point i will get if solve all problem ?

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

hope to reach pupil in this contest!

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

Hope I don't need to leave codeforces after this contest.

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

I hope, this will be the last rated div4 for me

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

This will hopefully be my last rated Div4:)

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

As a tester, this round is very nice :)

»
20 months ago, hide # |
 
Vote: I like it +130 Vote: I do not like it

No greetings to MikeMirzayanov?

  • -1000 social credit

  • -1000 aura

  • -rep from Mike

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

I will solve all under an hour!

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

    i visited your profile.. you never solved all problems... speed is only your handle, lmao :)

»
20 months ago, hide # |
 
Vote: I like it -16 Vote: I do not like it

is it rated for me?

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

Interactive at Div.4? o.O

Is this the first time in Div.4 to have an interactive? If so, I would be really curious to see what it'd turn out.

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

Hope it's my last div4

»
20 months ago, hide # |
 
Vote: I like it +18 Vote: I do not like it

This is the first contest blog I have seen with no thanks to Mike.

»
20 months ago, hide # |
 
Vote: I like it +21 Vote: I do not like it

if a 1400+ rated, participates with new account

then
»
20 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hope to be Specialist after this contest.

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

hope I can participating unofficially next div4 round

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

interactive problem for newbies and pupils. I think if newbies or pupils who can solve interactive problems, mostly the cheated or it's alt acc

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

    you want to say , in div 4 it only comes a binary search or two pointers and nothing more advanced , because it only rated for pupils and newbies?

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

Good Luck and Have Fun!

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

For the ones new to cpp and may not know much about interactive problems and flushing->

You dont have to flush the output when you are using "endl", just dont define endl as "/n" like many(including me do).

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

As a non-tester and non-participant, I would like to test future rounds (I never tested any round yet).

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

As a pariticipant, LaLeii orz

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

As a participant, DangKhoizzzz orz

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

Da fuq, i think i cant solve all problem because of interactive problem, i hate this

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

Queueforces

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

Queueforces

»
20 months ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

Inqueueforces

»
20 months ago, hide # |
 
Vote: I like it +53 Vote: I do not like it

Testing system is so overloaded that my solution exceeded compilation time: 274812981

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

Queueforces..

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

For ABCD, I spend much more time stuck in 502, 504, 405, etc. than solving problems

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

Why is cloudflare necessary (Genuinely asking)?

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

My first ever AK!! Very nice problems :) especially G2

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

B>G1

»
20 months ago, hide # |
 
Vote: I like it -19 Vote: I do not like it
hint for G
»
20 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Bro how to do B

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

Div. 3/4 interactive = $$$O(logN)$$$ with binary or ternary search, classic

At least it can be easily stress tested, which is good

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

easiest round imo where "hardest" task is low blue.

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

got the formula for problem F, failed to solve the modulo thing... sadge

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

Why is Problem G two parts? Is there really a solution for G1 that will not pass for G2?

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

    binary search on a and always take b = 999

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

    I think that they probably intended Binary Search for Subtask 1 and Ternary Search for 2, since log2(1000-2) is about 10, while log3(1000-2) is about 6.

    But the ternary search solution would of course also pass for subtask 1.

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

    yeah because log(999) is around 9 with base 2 which satisfies binary search condition for g1

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

      I defaulted to binary search on G1, because I never had to implement ternary search(up until today w/G2).

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

shitty round for python users

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

    why though? I'm doing python just fine

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

      the pypy compiler gave tle on the same solution where python3.8 worked fine

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

        I just checked out your D, and it's actually your fault that you got TLE.

        You keep appending to construct a long string (e.g. ans+=s[i]), which is slow. Python's string is immutable, which means it will always take $$$O(n)$$$ time to construct a string (where $$$n$$$ is the length of the string). Your code needs $$$O(n^2)$$$ time to run due to this, which is obviously not okay.

        It's interesting that Python runs faster on this code, though. I guess that it has some optimization (like skipping construction when there's only one reference). But whatever optimization Python has, you should avoid appending a string.

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

          yeah,thanks a lot

          but what alternatives should i go for when i have a task like this?

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

            String concatenation is a pretty basic technique -- try to google "build string in python" for in-depth tutorials. In sum, put string fragments into a list and do ''.join(list_of_fragments).

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

Can someone tell why this is throwing compilation error ?

same solution passes now

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

    I got the same issue, the checker says: "Can't compile file: Compilation process timed out.", so I guess the server was just so overloaded that it can't even compile the file lol.

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

I still don't understand how to solve B. I literally checked every possible case by hand. I don't know what's the right way to feel about this but I am furious.

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

    Maybe u didn't consider when u win 1 round and tie the other (that happened to me)

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

      No I did that, I did everything. I literally considered every possible way the numbers can be arranged relatively on a number line and this WA.

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

        In your code in the if(bl==br) block, u ignore totally al, that part seems wrong to me.

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

          that part was a last ditch attempt at doing whatever to get AC, the code I actually wrote must be my second last WA submission for B.

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

            btw the case when al == bl && ar > br that u insta print 2 is wrong, cause u can have br ==bl and that makes the answer to be 4

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

              Hmm now I get it, I though about this problem of bl and br being equal at the last moment, and as you can see I did something about it in the last moment in my last WA submission for B. But maybe due to crunch of time I left some cases.

              Thanks I lot, now I feel good. I saw jiangly's solution anyway. To see what he did is to first observe that there is symmetry in the order of checking winning games. Say we flip a random card from Suneet and Slavic, then the other ones are fixed to be picked on the second round, moreover Those other two cards if picked first would produce the same final score. With this observation we can fix picking a1 first, then whatever I pick from b, I check whether my points are greater than the opponent. we do a1 with b1 and a1 with b2, get the result and multiply the answer with 2, because the case of a2 will conclude in symmetric final results.

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

              Also, changed the line you pointed out and it's working. 274963920

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

Why didn't authors announce the 10 mins extend earlier???

I was about to get E right, then I saw 30 seconds left and gave up. Later on I came back and saw the announcement that the round had been extended for 10 mins.

»
20 months ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

Trolled in B and with the infinity queue took 40 min to fix the error xDn't

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

For D, I got WA on test case 1, but it worked just fine in my local compiler and online compilers

Lost multiple submissions, also each submission took too long to compile. Had to change same logic in python and it got accepted.

Couldn't find the reason, can you guys spot it? https://mirror.codeforces.com/contest/1999/submission/274845944

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

    It looks like there's a small mistake on your for loop statement:

    for(int j = idx + 1; j < s.size(); j--) {
    

    The j-- should be changed to j++. Decreasing $$$j$$$ in the condition will result in an infinite loop or unexpected behavior since $$$j$$$ will never reach s.size(). Correcting this to j++ should resolve the issue and give you Accepted.

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

Why this code is giving TLE in problem E.1999E - Triple Operations

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

    there is no restriction on l and r. So your code could iterate for 2e5 times for each testcase if all testcases have l=1 and r=2e5.

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

      Is this really the reason? I have a similar submission that passes but loops through l -> r:

      274871369

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

        You are correct. I tried to hack your solution but looks like your solution is could also have been tle had you used unnecessary local variables inside loop, instead of directly reading values from SOL array like you are doing now.

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

    You are looping from a to b for every test case. Imagine if there is 10000 test cases, each has a=1 and b=200000. Then you will TLE.

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

    there is no limit over the sum of l or r over all tests. Therefore, iterating from l to r is not viable for big number of tests. Try with prefixsum

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

mathforces

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

Can someone explain how this is TLE:

https://mirror.codeforces.com/contest/1999/submission/274946145

let n be 2*10^5, where l and r are <=n

the while loop is log3n and the for loop is constant operations in O(N) time as well

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

    You are looping from l to r for every test case. Imagine if there is 10000 test cases, each has a=1 and b=200000. Then you will TLE.

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

    ur complexity is t*n_max, which will give TLE

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

Tanked 5 TLEs on E because I calculated the prefix array in the solve() function :( Also couldn't figure out why I got WA for G2 test 2

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

How did so many people solved D?

E was just algebra and prefix sums

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

Hmm, quite easy div4, compare to the last 2 recent div4 rounds.

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

Best of luck everyone

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

The waiting queue is fucking long

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

Any specific reason behind these very long wait queues in div3/4 contests? In my case today one submission took >15 minutes to resolve?

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

Just got an observation for E:
[1, 3) -> all elements require 1 operations to become 0
[3, 9) -> all elements require 2 operations to become 0
[9, 27) -> all elements require 3 operations to become 0
[27, 81) -> all elements require 4 operations to become 0
[81, 81 * 3) -> all elements require 5 operations to become 0
and so on.

I think this could be optimal.

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

Please explain why this doesn't work in problem B (says expected 4, found 0 on 101st test case): https://mirror.codeforces.com/contest/1999/submission/274897075

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

    you're only considering when u win the 2 rounds, but it also can happen that u win 1 round and tie the other, u must include if(a>c && b==d)ans++ , and the others combinations of that.

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

    you can draw in one round and win in the second. which makes you win overall

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

why i got wa in 2nd test case.. 101st "wrong answer 101st numbers differ — expected: '4', found: '2'"

here's my solution: My B solution

can anyone explain, please???

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

    mayb its because you are not considering the a==c and b==d and a==d and b==c etc. these cases

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

      in these cases Suneet loses the round , right? but only considers those cases in which suneet wins i.e; (a>c && b>d),(a>d && b>c),(b>d && a>c),(b>c && a>d)

»
20 months ago, hide # |
 
Vote: I like it -11 Vote: I do not like it

interactive problems are SHIT

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

Struggled solving F for over an hour with multiple submissions failing at testcase 16+ because of mod (made me sad especially after I seeing that G was just ternary search :( Otherways very nice contest

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

on paper this gives best answer but why it fails on test cases ? `** ** ~~~~~ int fun(ll x){ int count = 0; while(x){ count++; x = x/3; } return count; } `** **void solve() {** ** ll l, r;** ** cin >> l >> r;** ** ll ans = 0;** ** ans += fun(3*l);** ** for(int i = l+1; i <= r; i++){** ** ans += fun(i);** ** }** ** cout << ans << endl;** **}```` ~~~~~

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

    The only problem with the logic is when you increas ans by fun(3*l) instead of 2 * fun(l). For example if l = 9 we would want to reduce the 9 to 0 first. To do that we would have fun(9) = 3 operations but simultaneously another number would be multiplied by 3 two times. And to reduce it to its original value we would again need fun(9) = 3 operations. That's why ans has to be 2 * fun(l).

    Also your code will hit TLE since you always recalculate fun(x). Instead of that you could precompute all of the needed values. I did it like this:

    vector<int> steps(200002);
    for(int i = 1; i < 200001) {
        steps[i] = steps[i / 3] + 1;
    }
    
»
20 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I am getting Idleness limit exceeded, How can this be fixed?

274961116

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

    ? a b — in response, we will measure the side lengths of an (a * b) rectangle

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

    I think you implemented the binary search wrong, so that it doesn't halt. instead of setting l/r to x you need to set it to l+1 or r-1 and also instead of checking wether r-l > 1, you need to check wether l is smaller or equal to r.

    Let me know if this works!

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

    Remove this line #define endl "\n"

    Ah no, actually your query is wrong, you need to cout 2 values

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

lowkey B is the hardest problem here.

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

How some brute force solutions passes in problem E ?

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

Was a good round!

»
20 months ago, hide # |
 
Vote: I like it +19 Vote: I do not like it

Just virtual'd this contest, nice query limit at G2! It's so strict that even a minor suboptimal tactic resulted in a wrong answer, and for educational purposes I really endorsed it!

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

div5??hhhh

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

I haven't participated since the last year, and I was hoping to got this round rated... :( Isn't there any way to have this as a rated one. At the morning I was a contestant and now it seems to be a practice round. I don't know how many points do I deserve

»
20 months ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

G1 and G2 were quite interesting learned about Ternary search.

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

Waited 27mins in queue for G1 just to get compile error :)

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

Hi Everyone

For Problem E ( E. Triple Operations) , I precomputed all the values using log_base_3 , but somehow it's giving incorrect result for 243 and 59049 , to pass the test cases i had to hard code the result , can anyone please help me here , why it's giving incorrect result.

For log values calculation i realized that precision values depend on the gcc compiler weird

Here is my submission — https://mirror.codeforces.com/contest/1999/submission/274923066

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

    Check this and this comment.

    As far as we're concerned, we only care about the integer floor of the log, and the numbers to get logarithm from isn't too huge, so we could actually bruteforce the log3 by continuously dividing the number by 3 until it reaches 0. TL;DR try to avoid floating point arithmetic as much as possible to escape precision issues.

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

It was one of the best round I ever seen. Thank you !

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

Help!!! All of my race records have disappeared!!!! WHY!???

»
20 months ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

This might be the longest system testing ever,will go on for more than 10+ hrs.

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

good contest:)

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

How much longer do we need to wait for ratings update? And how do y'all get to know when system testings are going on?

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

    go to the main contest page, where the problems are listed and on the right it will show the system testing progress.

    looks like it will take another 1-2 hours, ratings will probably take 12-24 hours after that.

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

I have one question ?

Are all Interactive Problems are Solved By Binary Search or Ternary Search

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

Nice round! I've become Specialist after this contest!

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

The appearance of this blog is to appeal the CF official sentence for my 1999F code。

Attention!

Your solution 274818573 for the problem 1999F significantly coincides with solutions daoqi/274818573, Haz_Begonia/274828630. 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://mirror.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.

【Codeforces Round 964 (Div. 4)AK实录】https://www.bilibili.com/video/BV17iameiEN8?vd_source=958d8670804c24a04935dc3755fc300a

Because I happened to be recording this game, you can see that the code for my F was written by myself。

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

Appeal against the incorrect skipped verdict of my Problem D submission

Greetings!

I want to appeal against the cheating verdict received for my submission of problem D of this round. I received the skipped verdict for this submission. I haven't copied this code from any public source, and I have completely written it. The logic for this code is pretty simple greedy approach and I believe that's the reason of the coincidental match with others solutions. I promise you to take a look at the rest of my submissions for this contest, combined with the submission. linked above will prove my innocence. Below are a few submissions, with whom my submission is claimed to coincide: anekdot/274758762, DevNorms/274768558, kvasilek/274772612, el_lobia/274776109, krizsu/274779701, long_off_long_off_sky/274781618, romtec/274784433, drgrenkenstein/274785579, Sino_2009/274792605, neheka9385/274792761, .Miraitowa./274794390,

MikeMirzayanov

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

MikeMirzayanov This comment is an appeal against the plagiarism verdict on my 274805223 for problem 1999D - Slavic's Exam.

I want to make it clear that I wrote the code entirely by myself and didn’t copy it from anywhere or use any external code.

The solution code is pretty short—only 10-15 lines (in the solve fucntion)—and the logic is straightforward. I used some trivial/common variable names, which might explain the similarity with other submissions. But honestly, it’s just a coincidence.

Please take a look at my other submissions in this contest too. 274850363, 274783573, 274754028, 274713747. I think you’ll see a consistent approach and the same use of debug template in all of the submissions. Even in this particular submission I have used multiple debug statements in the solution which proves my innocence. If I had copied the code, there was no need for me to go through the debug process while solving the problem, this shows my code is original.

This is the first time I’ve had this issue, and I’m confident it’s just a misunderstanding. I appreciate you looking into it.

»
20 months ago, hide # |
Rev. 4  
Vote: I like it +8 Vote: I do not like it

.

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

Hey!

I got plaged in this round at problem D. I don't know how. I use to give Claude AI my codes to rewrite it and make it not readable but keep the logic same. I use to do this after my solution was hacked by someone a while ago. My friend suggested to make the code less readable. But I can't be plaged for that. Since the code for this problem was very short it matched with some other guy. But please look closely at this code.

MY UPLOADED CODE is (that was rewritten by claude) — this

MY ORIGINAL CODE is — this

I was asked to post comment here to help me with my plag. Can someone please help me with this?

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

I am writing this comment to appeal for a wrongful accusation of cheating on me. I got an email last night that my solution 274819760 for 1999D - Slavic's Exam matches many other users'(whom I don't even know).

I assure you that all of my code was written in VS Code. I don't use any online compilers. This is the first time I'm getting this type of warning. I suppose my solution got flagged because of replacing the '?' with any lowercase letter, most people will first think of 'a' or 'z'. Also, the logic of this code is pretty trivial and straightforward, so there is a high chance that many other contestants used similar logic. The similarities are purely coincidental. The other submissions that I was accused of copying from were also not very similar to my code. I also wrote a redundant recursion function and a bunch of other redundant lines of code which were not needed that I forgot to remove while I was looking for an approach to solve the problem and debugging which proves my innocence.

I request you to look into my case and do not penalize me for any mistake of which I am not guilty of. I’m happy to provide any additional information that might help clarify the situation. Thank you for your understanding.

Here's the mail which I got:

Message