reirugan's blog

By reirugan, 5 months ago, In English

Hello, Codeforces!

I am very excited to invite you to my second-ever contest, Codeforces Round 1065 (Div. 3), which will start on Nov/20/2025 17:35 (Moscow time)! In this contest, you will be given 2 hours and 30 minutes to solve 7 problems, two of which have been split into subtasks. The subtasks for a given problem are not necessarily placed adjacently in the problemset.

The round will be hosted by the rules of educational rounds (extended ICPC). Thus, all solutions will be judged on preliminary tests during the round, and after the round, there will be a 12-hour phase of open hacks. After the open hack phase, all accepted solutions will be rejudged on successful hacks. Also, note that there is no score distribution — rank will be determined by number of problems solved, followed by penalty; wrong submissions will incur the usual penalty of 10 minutes, following the rules of educational rounds.

As a reminder, only trusted participants of the third division will be included in the official standings table. This is a compulsory measure for combating unsporting behavior. To qualify as a trusted participant of the third division, you must:

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

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

Also, note the rule restricting the use of AI. If you are caught breaking this rule, you will be condemned to life spent in prison the basement of some unspecified Codeforces user. Said person's basement is a rather unenjoyable place to live in, so I would advise adhering to the rules.

I would like to thank the following people for helping make this round possible!

Good luck, and have fun!

UPDATE: Due to issues with Cloudflare, the round has been rescheduled for Nov/20/2025 17:35 (Moscow time).

UPDATE: Editorial

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

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

As a tester, yuri is peak

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

a @reirugan round ? i wish it will be as good as your previous div3 round !!

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

anime kiss jumpscare

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

what's today's codeforces topic?

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

Could you please remove the gif?

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

codeforces when my mom enters the room

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

as a tester, this gif actually spoils the entire contest

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

I got jumpscared so hard by that gif.

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

Game's fucking gone

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

'condemned to life spent in the basement of some unspecified Codeforces user' when are we specifying this lad

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

As a tester, unspecified Codeforces user is yuri

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

As a tester, reirugan tested my yuri knowledge.

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

Hope I can solve a question or two

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

What is the anime name so I can watch it with my family later?

  • »
    »
    5 months ago, hide # ^ |
    Rev. 3  
    Vote: I like it -14 Vote: I do not like it

    I believe the GIF is from Samurai Flamenco.

    Edit: the GIF was changed today, current one is from Adachi and Shimamura.

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

Tester here — had fun with this round! Cool problems (gif got changed)

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

source? for cf practice ofc

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

wtf is that gif

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

we got gay codeforces before GTA VI?

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

sauce ?

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

add some problems with yuri :-)

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

I am now curious about the problem statement for this contest.

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

can't wait for the contest's problem statements

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

is this a hint that there will be at most 18 problems?

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

No way this was an codeforces notification!!

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

opening codeforces is never disappointing

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

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

This announcement just relieved all the fatigue from the latest contest in a blink! thanks for the GIF of Adachi!

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

I will give it a try; I hope it's as good as my previous Div-3 round!

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

waiting to become pupil!

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

As a participant always love to taking part in Div. 3 contests

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

Why do some problems feel trivial only in hindsight? Is the idea inherently simple, or do we just overthink when the timer is running?

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

Wth! is going on in the comment section. Someone please exolain in alice and bob terms

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

All my favorite NYU students have helped in this contest. Wow!

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

The picture is beautiful, feeling happy when opening codeforces.

Btw, who is the charactor in the picture?

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

As a reirugan fan good luck guys

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

I hope this contest will be much easier-

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

安達としまむら round!

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

sui chat bro

»
5 months ago, hide # |
 
Vote: I like it -9 Vote: I do not like it

I am a Newbie.

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

skibidi

Related ? $$$67$$$

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

Adachi Sakura!!!

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

How lucky I am to see a Yuri picture on CodeForces! It really makes me curious.

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

"macaquedev for pretending to test;" lol

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

The subtasks for a given problem are not necessarily placed adjacently in the problemset.

Uhh what do you mean by that??

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

    Usually subtasks are enumerated, for example, G1 and G2, and are therefore adjacent.

    In this case, it's possible the subtasks are enumerated with different nonadjacent letters.

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

My cf is ruined

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

Excited for battle!!!

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

Can I try? I'm just a new person

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

Llegar, partir y merendar

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

Hope to solve at least 5 problems,thus increase my rating.:)

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

    bro how you predict that?i really dont know, can you say for ex how many problems i need solve every div2 contests to reach speacialist

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

      In common, you should solve 3 problems or solve 2 problems fast(that depends on the difficulty of the contest) in div.2 to reach specialist. In div.3, the number of problems you solve is usually 5.

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

Thank God...No more interactive problems

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

Today is my birthday:)

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

how can i participate as a tester in a competition?

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

To qualify as a trusted participant of the third division, you must:

take part in (and solve at least one problem in) at least five rated rounds

what does it mean ?

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

    You need to have completed 5 CodeForces rated rounds, simply registering doesn't suffice, you also need to have solved at least one problem in those 5 rounds (actual participate). For example this div 3 is also a rated round.

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

hope everybody get a positive Delta

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

All the best to everyone hope i get closer to specialist

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

If I didn't participate in 5 rated rounds, Why I ain't trusted?

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

Looking for a "Demon Slayer" based contest if we are entering the zone of anime in cf!

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

Thank you cloudflare for forcing this round to be delayed

I blame the vibecoder that broke cloudflare's code

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

was the contest originally now and they postponed it or am I tripping

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

looks like due to codeforces being down for some time the round will be delayed for two days?

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

What just even happened XD

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

what is wrong with cloudflare :》

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

I was looking forward to the yuri. At least it didn't happen during the actual round.

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

Why is the contest delayed?

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

hello?

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

Wtf???Rescheduled , was looking forward for the contest.

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

Now Contest is Delayed!

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

Actually it went well just before the contest begin...lol

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

I hate Cloudflare:(

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

just wanted to solve some Div3 for me

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

It's amazing that Cloudflare is fixed a minute before the original contest start time.

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

It has delayed.

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

I'm seeing that Shayan's and Arpa's streams are scheduled to release within the next three hours. Please get rid of them!

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

    Arpa's video has already been delayed

    I believe Shayan hasn't prerecorded his video; my understanding is that he usually screenrecords live during the contest

    Thanks for pointing it out, though!

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

Cloudflare be trippin :cry:

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

Let's go, the contest got rescheduled, and now I'll get my well deserved normal sleep time.

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

As Cloudfare is back in service, are there any chances that the contest's date returns to being today?

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

Why the contest has delayed but the stream has not delayed?

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

Was praying that it gets rescheduled. Thanks:) . As a contestant , I hope to get plus delta!

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

Why 48 hours delay :(

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

Just after rescheduling the contest ,the cloudflare came back ! noice:)

»
5 months ago, hide # |
 
Vote: I like it -19 Vote: I do not like it

The issue with Cloudflare is fixed, you should reschedule it back to today

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

So, Cloudflare has always been the villain?

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

I came home in turbo mode for the contest and codeforces said, 'Relax bro, we are delayed!' Perfect, I rushed for maximizing my frustration!

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

cloudflare disappointed us all

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

thanks i have my exams tomorrow. 2.5 hrs saved. I'll utilise this in sleeping

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

there are two long days left to wait

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

W organizers!!! I thought I would miss todays round (╥﹏╥)

»
5 months ago, hide # |
 
Vote: I like it -15 Vote: I do not like it

What was the earlier gif :) reirugan

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

I hate Cloudflare...

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

Dead internet theory has a new definition now

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

Damn it. We just lost an opportunity to witness a fairest CF contest ever!

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

Non-hackers getting a crawling ban is sweet justice given all the pain hackers have experienced over the past year.

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

Try CF Submitter : https://marketplace.visualstudio.com/items?itemName=DevXSayan.cf-submitter — Fetch all the problems of a live contest inside vscode, view questions without reloading hustle, run test cases, and submit in one click, all without leaving vscode

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

Aim to solve A to E

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

This is going to be my first rated contest, im very excited, hoping get some rating :D

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

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

Adashima is the best!

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

CONTEST ABOUT TO START

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

C2 > DEFG

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

Div. 3>>1

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

For problem E,my code 349964120 construct a permutation with atmost 1 bad index.I wonder whether 6 was there just to confuse.

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

My B solution kept failing on some hidden case, I am confident my logic is correct. Also for D, I was trying to use DSU based approach but kept timing out. Any ideas on approach for problem D?

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

    For problem D

    Spoiler

    I hope I wrote it clearly)

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

In Problem E, why multiples of 2, 5 and 10 doesn't work but multiples of 2, 3 and 6 work ?? Is it because we can have at most 6 bad indices and not 10 indices ?

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

    we can make 0 bads as well , the fact that matters is that for any N there are total primes always <=N/2 with N :)

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

    a proof for why 2,3 specifically work:

    consider a solution of the form

    **_**_**_...

    where the * themselves form a sequence s.t. the adjacent * are not coprime. clearly, such a solution has no bad indices. so, it suffices to find a sequence of the * numbers with length >= 2n/3.

    consider multiples 2 and 3. it now suffices to show that these cover 2/3rds of 1 .. n. consider partitioning 1 .. n into disjoint groups of 3 starting from 3. let j be the first number in the block (e.g. 3,6,9,etc.). if j%2==0, then j%2==0 and (j+2)%2==0. so we have covered 2/3 numbers in the range j,j+1,j+2. if j%2!=0, then j%3==0 and (j+1)%2==0. so we have also covered 2/3 numbers in this range. so, from any n we can form a valid sequence * using multiples of 2 and 3, but making sure we carefully place 6 to connect the 2 and 3 multiples. so we use 2 4 8 .. 6 3 9 15 .. for the *'s and fill in the rest.

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

felt like this was hard compared to other div3

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

I was able to do G in $$$O(N * log(N) ^ 2)$$$
Code link: https://mirror.codeforces.com/contest/2171/submission/349941964

Is there a better solution?

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

That was an awesome contest for me! After giving so much effort, i solved the c problem

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

I solved A, C1 and C2 but not B wtf?

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

Is this div2?

»
5 months ago, hide # |
 
Vote: I like it -17 Vote: I do not like it

Trash round.

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

Felt difficult than almost all the div3 I participated in till now ...

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

F is much easier than E, and is too close to D, separating them by E was just evil.

Also, I skipped the first sentence of each problem since it add nothing to the statement, this also caused me to not notice that it has two versions...

»
5 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it
void sol(){
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>p[i];
        a[p[i]]=i;
    }
    if(a[1]<a[n]){
        cout<<"Yes\n";
        return;
    }
    int mx=1,mn=n; 
    for(int i=a[1];i<=n;i++) mx=max(mx,p[i]);
    for(int i=1;i<a[n];i++) mn=min(mn,p[i]);
    cout<<(mn<mx?"Yes\n":"No\n");
}

I got an WA on pD but I don't know why. Can anyone help me? thx

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

    Check this case 4 6 2 5 1 3

    Your answer is NO, but the correct answer is YES.

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

    n = 9 consider { {5, 6, 7, 9}, {2, 8}, {1, 3, 4}} All the three components are connected. But min(first) > max(last)

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

I personally not satisfied by today's div3 :( Maybe I will get downvotes. I just shared my sadness

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

How tf is this a wrong edge list !?

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

I'm so happy to reach such a high place in this round! The thrill just won't go away!

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

C1 & C2 are nice problems! I was looking at C2 and had absolutely no idea how to do it but after a quick peek at C1 I had an observation that got me through C2!

Had it not been for C1 i would have been stuck at C.

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

Why would you want to make the mod 1e6 + 3 on G?

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

    Do you have a solution that does not require precomputing factorials?

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

      I missed this. You're right. Thanks for explanation :)

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

      If all the constraints are kept the same except for the mod (most importantly, $$$1 \leq a_i \leq b_i \leq 10^6$$$ is kept) and we only considered $$$t = 1$$$, I'm aware of a (partial) solution with two steps than can be done in $$$O(n)$$$ for the first step and $$$\tilde{O}(sqrt(mod))$$$ for the second step (per test case). This idea still requires precomputation, but only for factorials up to $$$b_i - a_i$$$, so we need an additional $$$O(max(b_i))$$$ precomputation. With $$$t = 1$$$, this idea can support mods around $$$10^9$$$, however it 1) cannot be used to solve G for significantly larger $$$t$$$ (I suspect $$$t = 10$$$ already causes TLE) and 2) is definitely not suitable for Div 3, for reasons I will explain later.

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

Can someone please tell me why my dsu code for D is giving WA? Submission:349981598

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

    Consider the case 3 5 2 1 4

    Your answer is NO, but the correct answer is YES.

    Step 1, the code performs union(5, 3).

    Step 2, the code only performs union(4, 1) and union(4, 3).

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

      Thank you so much. I spent half an hour trying to find the problem.

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

I gave this contest after registration properly. And it was my first contest. Then why it is appearing in unrated section and not in rated section for me? Help pls

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

I introduce a solution of problem E,but I can't prove it(maybe I just know a little) Firstly, make a number of (n/2)+1 called Rt , and continue ues it ,if it's a prime number,put in the first.And then,from 2 to n,make the number mutiples,every time chose two number,such as (prime number, a,b(a and b have mutiples relation)),continue to put such numbers,until Rt > n ,put other number using mutiples relation, ans you will pass the problem.

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

i was registered as unrated by mistake in Codeforces Round 1065 (Div. 3) .please check my submissions my name is Manisha0369

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

Can anyone tell / give any hints IN C problem in genral?

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

    try playing the game starting from the index 1 , think like u are the player playing the game and what optimal moves(swap) u need to play in order to :

    1. maximise(greater than ur opponent) ur score , meanwhile
    2. the swap operation must not increase ur opponents score so that ur opponent's score became greater than ur current score .

    or in more simple words , at the ith move , u can either choose to swap or not to swap. swap only if the operation increase ur score than current or it decreases ur opponents score.

    // here the easy version assumes only 0s and 1s hence the solution is a lil bit different , the above explained algo fits best with the hard version

    // C1 — easy

    /*
    code by - Aryan Shrivastav
    */
    
    /*
    observations : 
    
    */ 
    
    #include<bits/stdc++.h>
    using namespace std;
    
    #define ll long long
    #define vi vector<int>
    #define vll vector<long long>
    #define co_endl cout<<'\n'
    #define f(i,a,n) for(int i=a ; i<n ; i++)
    
    void SOLVE(){
    
        int n;
        cin>>n;
    
        vi a(n);
        vi b(n);
    
        string ans;
    
        int total_a = 0;
        int total_b = 0;
    
        f(i,0,n){
            cin>>a[i];
            total_a+=a[i];
        }
    
        f(i,0,n){
            cin>>b[i];
            total_b+=b[i];
        }
    
        f(i,0,n){
            if(i%2 == 0){ // ajisai turn
                if(total_a%2 == 0){ // total_a is even 
                    if(a[i]==0 && b[i]==1){ // swap
                        a[i] = 1;
                        b[i] = 0;
                        total_a++;
                        total_b--;
                    }
                    else if(a[i]==1 && b[i]==0){
                        a[i] = 0;
                        b[i] = 1;
                        total_a--;
                        total_b++;
                    }
                }
                else{ // total_a is odd // dont swap
                }
            }
            else{ // mai turn
                if(total_b%2 == 0){ // total_b is even 
                    if(a[i]==1 && b[i]==0){ // swap
                        a[i] = 0;
                        b[i] = 1;
                        total_a--;
                        total_b++;
                    }
                    else if(a[i]==0 && b[i]==1){
                        a[i] = 1;
                        b[i] = 0;
                        total_a++;
                        total_b--;
                    }
                }
                else{
                    // dont swap
                }
            }
        }
    
        int ans_a = total_a%2;
        int ans_b = total_b%2;
    
        if(ans_a > ans_b){
            ans = "Ajisai";
        }
        else if(ans_a < ans_b){
            ans = "Mai";
        }
        else{
            ans = "Tie";
        }
    
        cout<<ans;
    
        co_endl;
    
    }
    
    int main(){
    
        int t;
        cin>>t;
        while(t-->0){
    
            SOLVE();
    
        }
    
        return 0;
    }
    
    

    // C2 — hard


    /* code by - Aryan Shrivastav */ /* observations : */ #include<bits/stdc++.h> using namespace std; #define ll long long #define vi vector<int> #define vll vector<long long> #define co_endl cout<<'\n' #define f(i,a,n) for(int i=a ; i<n ; i++) void SOLVE(){ int n; cin>>n; vi a(n); vi b(n); string ans; int total_a = 0; int total_b = 0; f(i,0,n){ cin>>a[i]; total_a^=a[i]; } f(i,0,n){ cin>>b[i]; total_b^=b[i]; } f(i,0,n){ if(i%2 == 0){ // ajisai turn if( (total_a ^ a[i] ^ b[i]) > (total_b ^ b[i] ^ a[i]) ){ total_a = (total_a ^ a[i] ^ b[i]); total_b = (total_b ^ b[i] ^ a[i]); // swap int temp = a[i]; a[i] = b[i]; b[i] = temp; } } else{ // mai turn if( (total_a ^ a[i] ^ b[i]) < (total_b ^ b[i] ^ a[i]) ){ total_a = (total_a ^ a[i] ^ b[i]); total_b = (total_b ^ b[i] ^ a[i]); // swap int temp = a[i]; a[i] = b[i]; b[i] = temp; } } } int ans_a = total_a; int ans_b = total_b; if(ans_a > ans_b){ ans = "Ajisai"; } else if(ans_a < ans_b){ ans = "Mai"; } else{ ans = "Tie"; } cout<<ans; co_endl; } int main(){ int t; cin>>t; while(t-->0){ SOLVE(); } return 0; }

    do reply me if u got the approach and consider upvoting it :)

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

Why my C1 solution showing in queue ? Is this issue with other's also ?

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

(In China, CF1065 starts at 22:35)

Yesterday night: OK I passed A B C1 C2 D F

Then I go to bed

This morning: Yes I was not been hacked

(I had to do a stupid contest so I wasn't on CF in the morning)

In the afternoon: Let me see... Oh no FST on C1 C2 F

I wanted to see how I get hacked, then I see it was just in queue

me be like:https://cdn.luogu.com.cn/upload/image_hosting/3bz1srce.png

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

How to upsolve any problem, when i try to submit problem after contest is over while upsolving it says "Contest is Over" ???

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

i guess $$$O(m \sqrt m)$$$ memory gets passed in problem H (you just need to use 16 bit integers) 349971224

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

I’m new to cp and codeforces. I registered for this round and participated but I am seeing that it was unrated for me. I am confused because I didn’t choose to register as unrated and there wasn’t an option for choosing between rated and unrated (at least for me). I registered days before the competition. What might be the cause of me being unrated for the competition?

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

My rating is 1177 and had never got higher than now. I have solved at least one problem in at least five rated rounds, such as 1858, 1879, 1878, 2166, 2169. And I had never cheated in any round. But I wonder why it shows "Unrated allowed"?

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

how much more time for ratings to be updated?

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

Hello

Can anyone please help me to find cases in which mine code will fail (Give Tle) for problem — F It is giving tle on test case — 12 Thanks for helping

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
const int mod = 1e9 + 7;
#ifndef ONLINE_JUDGE
#include "debug.h"
#else
#define deb(x...)
#endif
void solve();
signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll t;
    cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}

bool check(vector<int> &a, int n)
{
    int mex = 1;
    set<int> st;

    for (int i = n; i >= 2; i--)
    {
        int ele = n - i + 1;

        st.insert(a[i]);

        while (st.find(mex) != st.end())
        {
            mex += 1;
        }

        if (mex == ele + 1)
        {
            return 1;
        }
    }

    return 0;
}

void solve()
{
    int n;
    cin >> n;
    vector<int> a(n + 1);

    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
    }

    if (check(a, n))
    {
        cout << "No" << endl;
        return;
    }

    set<int> st;
    vector<vector<int>> ans;

    for (int i = n; i >= 1; i--)
    {
        auto id = lower_bound(st.begin(), st.end(), a[i]);
        vector<int> rm;
        for (auto it = id; it != st.end(); it++)
        {
            ans.push_back({a[i], *it});
            rm.push_back(*it);
            if (ans.size() == n - 1)
                break;
        }

        if (ans.size() == n - 1)
            break;

        int size = rm.size() - 1;
        for (int j = 0; j < size; j++)
        {
            st.erase(rm[j]);
        }

        if (rm.size() == 0)
            st.insert(a[i]);
    }

    cout << "Yes" << endl;
    for (auto val : ans)
    {
        for (auto node : val)
        {
            cout << node << " ";
        }
        cout << endl;
    }
}
»
5 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

how to solve D using DSU?

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

i cant write a comment here

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

    I have a very easy solution to c1 and c2, you just have to change the checking condition in the c2 version. Now it says that the play should be optimal, that means if it's the first player's turn and he is ahead in score , then he won't swap. Likewise , if he is down by one then on his turn if on swapping his score increases then only he will swap otherwise not. Second player would do the same. Therefore,the solution might be a very simple greedy approach where on the i'th turn, each player checks the score and then swaps.

    Now C1 SOLUTION----->

    [submission:349984404]
    

    The snippet shows that first we calculate the original xor of all elements,then on each move swap them. If the score increases like it can be 1 or 0 only. Then on swapping the score of both of them will become their negation.

    C2 SOLUTION -------->

    [submission:349987068]
    

    In the C2 problem, the score now won't remain 0 or 1, but the logic remains the same, first calculate the default xor of all numbers then the greedy approach to check on each move whether the scores will change or not. We just update the scores in different way in C2 because in C1 only 0 or 1 were possible pair of total xor scores. Thank You, Niksy

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

I missed that. As i am a beginner in here in codeforces.

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

Cloudflare engineer: Oh no, there's a bug! Quick, get GPT-5 to fix it!

GPT-5: Hey, I need Cloudflare to work properly!

Microsoft engineer: LOL

Codeforce: Hahahahahahahahahahahahahahahahahahahahahahahahahaha, kids, you're going to unrated again!

(Source: Luogu)

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

Hello, I received a plagiarism warning for solution 349932806 for problem 2171C1. I want to clarify that I did not share my code with anyone, nor did I use anyone else’s code.

I solved the problem by myself and only used my own template / common CP snippets that many users also use. If needed, I can explain my approach or share my local work.

Please review my case. Thank you.

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

Hello, I received a plagiarism warning for submission 349917059 for problem 2171D. I want to clarify that I did not share my code with anyone, nor did I use anyone else’s code.

I solved the problem myself. However, I used Ideone to test during the contest, and I later realized the code was accidentally left in public mode. This may have exposed my code and caused the similarity.

I did not share it intentionally. Please review my case. Thank you.

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

Hello — I received the plagiarism notice for my submission 349871347 to problem 2171B.

I did not copy other users’ code. I wrote the solution myself during the contest. To support this, My submission time for that particular question was 20:14 UTC +5.5 20 Nov 2025 and the other person's timing was 21:03 UTC +5.5 20 Nov 2025 I don't know the person and I have written my code myself If you look at the code, it is very simple so it has a high chance to coincide in my opinion

Please let me know if you need any additional logs. I’m happy to cooperate to resolve this. Thank you.

Here is my solution : ~~~~~ t = int(input()) for _ in range(t): n = int(input()) a = list(map(int, input().split())) if a[0] != -1 and a[-1] != -1: ans = abs(a[-1] — a[0]) else: ans = 0 if a[0] == -1 and a[-1] == -1: a[0] = 0 a[-1] = 0 elif a[0] == -1: a[0] = a[-1] elif a[-1] == -1: a[-1] = a[0] for i in range(n): if a[i] == -1: a[i] = 0 print(ans) print(*a) ~~~~~

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

Hello, I received a similarity warning for my solution in this round. I did not share my code with anyone or copy from anyone. It is possible that I once used an online IDE that unintentionally made my code public. I understand this is against the rules even if unintentional, and I sincerely apologize. I will make sure this never happens again. Thank you for checking.

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

very ezzz round for div.3

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

great one to perform but loss the pointtttt..

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

shoutout to the lesbians for this goated yuri themed contest

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

Tbh when i see a div 3 i smile it's easy and so amazing to pass , Hope they will be more div 3's by the time and also Good luck To everyone on this kind of contests or else !

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

That animation is so cool. I just love it