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

Автор yash_daga, 2 года назад, По-английски

Hi Everyone :)

I would like to invite you to my first Codeforces Round, which I set with my friends JaySharma1048576 and mexomerfCodeforces Round 921 (Div. 1) and Codeforces Round 921 (Div. 2) which will be held on Jan/27/2024 17:45 (Moscow time). This round will be rated for both divisions.

Both divisions will be given 6 problems and 2 hours to solve them.

One of the problems may be interactive. So, you are advised to refer to the guide on interactive problems in case you are not familiar with them.

We would really like to thank:

Good luck, have fun!

Disclaimer

UPD: Scoring Distribution

Div. 1: $$$500 - 1000 - 1500 - 1750 - 2500 - 3000$$$
Div. 2: $$$500 - 1000 - 1250 - 1750 - 2500 - 3000$$$

UPD: Here is the editorial

UPD: Congratulations to the winners

Div. 1:

  1. jiangly
  2. maroonrk
  3. Benq
  4. gamegame
  5. maspy

Div. 2:

  1. kto_eto
  2. fractum_locum
  3. nmsl
  4. beiyuli
  5. BabaVoss

First solves -

Div. 2:

Problem Participant Time
A jayeshkriplani007 0:01
B Ianlsam 0:02
C rolandpetrean 0:08
D Ignut 0:16
E CoanCoan.com 0:38
F HexShift 1:13

Div. 1:

Problem Participant Time
A Geothermal 0:02
B Benq 0:15
C gisp_zjz 0:13
D Rebelz 0:28
E gyh20 0:32
F Szoboszlai10 1:20
  • Проголосовать: нравится
  • +190
  • Проголосовать: не нравится

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

good luck

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

I've been waiting for this competition for so many days!

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

Oh, it is my turn: 🥹

As a tester, the problemset is delicious and I hope you enjoy.

Also, ahmet23 orz!!!

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

How many problems are there in both divisions?

btw the duration of 2h is pretty nice :)

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

orz sir yash_daga

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

Where is the score distribution? Best of luck to all contestants!

»
2 года назад, скрыть # |
 
Проголосовать: нравится -15 Проголосовать: не нравится

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

So why is the registration limit for Div.2 round changed to less than 1900?

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

ok nice me also from jharkhand :) waiting eagerly

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

Guess Which problem will be Interactive for Div2

1.C 2.D 3.E 4.F

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

orz yash_daga sir!!!

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

Opened CF after months just to upvote this, hail ISM!!!

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

All the three problem setters have solved most problems related to maths and greedy. So, I suspect Mathforces or Greedyforces incoming.

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

right before usaco :c unfortunate

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

its going to be my first contest written by indians and i am very excited for this.

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

I love the way he writes "You".

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

rp++

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

Claimer

There may be some pieces of paper harmed during my participation of this round :(

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

This is my first competition i have ever done, I'm not that good, but ill see what I can do lol

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

This is my first contest after eight months away...felt so good back to this cf vibe again!

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

why delayed

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

One refresh costed me 10 mins of time

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

This is becoming a habit now.

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

Delayforces again...

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

Waiting for love :(

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

Did anyone see the questions

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

1 Refresh cost me 10 min.... :)

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

GoodBye 2023 is that u?

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

GLHF

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

why this website is being too heavy to reload in browsers??

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

I could have finished my LoL ranked game, now I lost a star and 10 minutes waiting.

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

I wasted hours on origami to do 1C.

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

Paperforces

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

Сейчас бы участвовать в раундах от Упирвицкого

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

What is wrong with question C

I dont get why my code is failing ahhhh damnn it !!!

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

WAForce

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

It took me 10 minutes to do Div2D while 75 minutes to do Div2C,i'm really bad at implementation.

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

Was I alone to do so? :D

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

Was lazy segtree expected on E ? I got tle on pretest 32...243653603

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

div1B is disgusting

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

Thanks for the round! Feedback on the problems:

A: Good problem, appropriate difficulty for its position.

B: Not my favorite problem (unless there's a better solution than just killing it with a segtree / a set?); all the ideas involved felt standard, but because DS was involved it still took a decent chunk of the round to implement. (Also, implementation would have been mildly less annoying if the array X was sorted; I also would have found it easier if the input was passed as (X, V) pairs and not as an array X followed by an array V.)

C: I strongly disliked this problem. It felt basically like a pattern guessing test--maybe some people had the visualization skills to solve the problem rigorously, but I basically guessed a pattern that seemed reasonable, checked that it works for small cases, and then got AC.

D: Realizing that the problem reduces to "find the number of sequences of A balanced bracket sequences with total length B" was pretty nice. The rest of the problem was damaged by the constraints in one of two ways. After thinking of smart ways to count these sequences since the mod suggested FFT was unintended, I ended up just throwing in the KACTL FFT with arbitrary modulus template, which got AC, though running somewhat close to TL (800ms, not slow enough that I was worried about FST but definitely slow enough to TLE FFT templates with bad constant factors).

I don't know whether this solution was intended or not. I suspect not because of the choice of mod, but if this was intended, then I strongly dislike the choice not to use 998244353 as the modulus, and I also don't like the TL (I would have set something like 3s if FFT/NTT was intended).

Assuming this solution was not intended, it's a tougher situation, especially if the intended solution takes O(n^2) memory or O(n^2 log n) time. If one of these is the case, I honestly might have just let FFT pass anyway (and set a more friendly modulus and TL) since I think it'd be really hard to cut FFT cleanly and the first observation is nice enough to justify the existence of the problem. If there was room, though, I would definitely have set n = 5000. As is, I think "FFT works, but you have to use a slightly unconventional template and it runs close to TL" is a very bad state for the problem.

E: Probably my favorite problem of the round (though I'm biased in favor of EV problems). Not hard enough for its position or point valuation imo.

F: Interesting problem, I had no nontrivial ideas. I think the story got in the way of the statement, and you could state the problem more formally in a shorter and more readable way. I think something to the effect of "there exists a hidden integer x from 1 to n, you can query ranges and judge will output 1 if x is in the range and 0 otherwise, judge is guaranteed not to tell the truth or lie three times in a row" would work, without all the flavor text about the students or explicitly enumerating the four cases.

  • »
    »
    2 года назад, скрыть # ^ |
    Rev. 14  
    Проголосовать: нравится -10 Проголосовать: не нравится

    Will You stream solutions? How did you do C?

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

    Bro Can you explain C

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

      2C: We construct the shortest string T that is not a subsequence of S as follows. Iterate through the characters of S and maintain the list of characters we've seen so far. Once we've seen all k characters, add the last character we reached to T and reset the list of characters we've seen. Once we finish going through S, add any character we haven't seen yet to T. Any shorter string can be found in S (we can find the first character of such a string in S before the first character of T, the second character of the string before the second character of T, and so on); I'll leave it as a (simple) exercise to prove that T cannot be found in S.

      If T has length at most n, add additional characters until it has length n and output it as our answer. Otherwise, no answer exists.

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

    I think D might just be https://en.wikipedia.org/wiki/Catalan%27s_triangle. I just checked some smaller cases and didn't prove though.

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

    Hi, Thanks for the feedback!

    Intended soln of D :)
  • »
    »
    2 года назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится +23 Проголосовать: не нравится

    The model solution of Div. 1F does require some non-trivial ideas. I will release the detailed editorial shortly but till then, here is one of the ideas that you may have missed.

    Hint

    Thanks for the feedback. From next time, I will try to keep the statement concise.

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

      Thanks for sharing! I'll give it a bit more thought :)

    • »
      »
      »
      2 года назад, скрыть # ^ |
      Rev. 4  
      Проголосовать: нравится +15 Проголосовать: не нравится
      Improving Number of Queries
  • »
    »
    2 года назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится

    On Div2D I figured out the correct fraction quickly but wasted the second half of the contest on figuring out WHAT IS A FRACTION MODULO 1e9+7. Also on trying __int128 or Python, because the unreduced denominator can reach 10^20 and goes beyond the long long limit. Could you please tell if this is avoidable?

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

    I googled this explicit formula for the convolution of Catalan numbers: https://mirror.codeforces.com/blog/entry/87585

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

    I have a solution for C, based on capes of paper, once you fold the paper once there are the same number of capes upward and downward(this mean that all steps before that increments both values equally) so you have V=M + 2*sqrt(2). So in every steps the number of capes get multiplied by two, while the perimiter of the square is multiplied by 1/sqrt(2) then you have a geometric progression.

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

Too curious to know where I failed on C. T_T

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

For d1C, was anyone able to reproduce N = 7 irl? The most I could get is N = 4.

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

Was submitting C in last 30 seconds, but Checking if the site connection is secure take a minute

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

Is it the problem setter of d1B in a loss of loved ones that he doesn't even guarantee $$$x_i$$$ is in an ascending order but doesn't even show it in the sample either?

btw, i don't understand what the data range is for for d1D.

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

How the hell to mod a rational number? I've managed to get a working solution for d, getting nominator and denominator, but i still don't have an idea how to convert them into valid answer...

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

hello

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

mathforces...

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

Anyone thought the position of harbour in div1B/div2E is sorted and keep getting WA at pretest 5?

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

couldn't solve Div2C(Div1A) in 100 minutes

I'm such a brainlet

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

Too much implementation for a div1 B ...

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

My rating gonna drop due to C. Fuck C

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

C anyone?

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

    I think the point was to check for all intervals of length n if every one of the k letters are in it, if not then the answer is no. Again I'm not sure but if that premise is right you can easily think of a way to construct a string that is not possible.

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

      1 3 3 11 aabbccabac

      test case where you can fail.

      • »
        »
        »
        »
        2 года назад, скрыть # ^ |
         
        Проголосовать: нравится 0 Проголосовать: не нравится
        void solve() {
            int n,k,m;
            cin>>n>>k>>m;
            string S;
            cin>>S;
            vector<int> count(k,0);
            map<char,vector<int>> mpp;
            for(int i=0;i<m;i++){
                count[S[i]-'a']++;
                mpp[S[i]].pb(i);
            }
            string ans="";
            for(int itr=0;itr<k;itr++){
                if(count[itr]<n){
                    char ch = itr+'a';
                    for(int i=0;i<n;i++){
                        ans+=ch;
                    }
                    cout<<"NO"<<endl;
                    cout<<ans<<endl;
                    return;
                }
            }
            for(int itr=0;itr<k;itr++){
                char ch = itr+'a';
                vector<int> v = mpp[ch];
                for(int i=n-1;i>=1;i--){
                    int index = v[i-1];
                    int occurence = n-i;
                    string ans="";
                    map<char,int> temp;
                    for(int j=index;j<m;j++){
                        temp[S[j]]++;
                    }
                    for(int p=0;p<k;p++){
                        char check = 'a'+p;
                        if(check==ch){
                            continue;
                        }
                        if(temp[check]<occurence){
                            cout<<"NO"<<endl;
                            for(int hehe=0;hehe<i;hehe++){
                                ans+=ch;
                            }
                            for(int hehe=0;hehe<occurence;hehe++){
                                ans+=check;
                            }
                            cout<<ans<<endl;
                            return;
                        }
                    }
                }
            }
            cout<<"YES"<<endl;
        }
        
        

        Can you tell where does this code fail??

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

    Straight DP:

    Find first position of all k letters. It would base for len = 1.
    Then for each i = 2..n you must have all k letters after all k letters positions for i - 1. If you keep it properly with reverse link, then construct answer should be easy.

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

WTF I didn't submit 1D just because of this 'Just a moment' thing!!!

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

Task C is a very funny task. 10 sheets were damaged

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

I tried to solve problem B using segment tree. But I couldn't do it in integers, because I was required to combine several multiplications; and I couldn't also pass it using floats. How to pass segment tree?

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

how D?

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

I felt statement of Div2D to be ambiguous and misunderstood several times. I initially thought once a pair is picked, then its value keep on increasing by one for every next excursion irrespective of what pair is chosen next.

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

I somehow liked Div1C and Div1E, disliked Div1B, but anyway: Please polish the problem statement before the round (Div1B: "next harbour" concept is strange, Div1D&Div1E: two variables are interchanged, etc.) and please check it carefully for the clarification (I got two wrong responses in this round...).

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

I solved 3 problems, I am enjoyed this contest. Thank You

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

why CF doesn't let us submit code to check after contest ends :( Just missed submitting E by few seconds and now waiting to see if my solution is correct. Pretty frustrating to wait more.

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

I had fun in this contest. The D reminded me of JEE days. Thank you for fun contest.

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

what is wrong in my solution for question C. My Submission

what I was doing to divide string s into a complete chunk of k alphabets and if someone is missing in last chunk I take this character to form a valid subsequence not present in s.

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

Cloudflare is horrible

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

div2B O(n^0.5) with n = 1e8 timed out in python :(

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

What is "orz" btw?, I saw some people saying that?

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

Waiting for tutorial :)

How to know when it will be released?

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

The test cases are very weak for Problem Div2 B. some solution of complexity 1e10 also passed

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

Lol, spent last 33 minutes of the round debugging Div.1B, only to understand after the round that coordinates are not guaranteed to be sorted.

In my opinion, such problems problems should contain coordinates already in adequate order.

Div.1B/Div2.D should check participant's ability to invent and implement solution, not ability to carefully read problem statement...

Otherwise, problem is quite nice

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

speed forces yet bricked

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

I might be risking losing all my testing privileges here, but I would like to point out that div1A (or div2C), as well as div2A, were pointed out by me during testing to be very close to a certain CSES problem. According to the judgment of the coordinator, "D2A can be not really new," so I kind of assumed they'd be removing the div2C (it was A2 earlier) but not the div2A (which was A1).

My question is — is this expected by contestants? My perception is that it is not, and I feel there should definitely be some more originality in problems that are supposed to be around D2C in difficulty (D2A being unoriginal is probably arguable, so I won't comment on that).

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

A: It is easy to find out, that size of our answer is $$$nk$$$ (at least because it must contain all $$$aa...aa$$$, $$$bb...bb$$$, etc). So, we can just break our answer into $$$n$$$ blocks of length $$$k$$$. Each block will contain all first $$$k$$$ letters of the alphabet. So, our answer is $$$"abc...$$$($$$k$$$-th letter) $$$"$$$ repeated $$$n$$$ times. $$$O(nk)$$$ per test.

B: Basically, we need to find such array $$$a$$$, that $$$a_1 + a_2 + ... + a_n = x$$$ and $$$gcd(a_1, a_2, ..., a_n)$$$ is maximum ($$$a_i \gt 0$$$). If $$$gcd(a_1, a_2, ..., a_n)$$$ is equal to some $$$k$$$, that means, that each $$$a_i$$$ can be represented as $$$k * \frac{a_i}{k}$$$, so our sum will be $$$k * (\frac{a_1}{k} + \frac{a_2}{k} + ... + \frac{a_n}{k}) = x$$$. From here we can see, that $$$k$$$ will be divisor of $$$x$$$, so we can iterate over all divisor of $$$x$$$ (let it be $$$d$$$) and check if $$$\frac{x}{d} \ge n$$$, as we want to make each $$$a_i \gt 0$$$. $$$O(\sqrt{x})$$$ per test.

C: We can do a greedy approach to find such string, that doesn't occur as a subsequence. The algorithm is basically the same as when we solve "Does string $$$t$$$ occurs in $$$s$$$ as subsequence?", but we want to shift our pointer as further as possible. So, we will pick the furthest first occurrence of some letter starting from our current position, after that we will shift our position to the right of that picked one and remember letter on chosen position. If we didn't lack any letter during $$$k$$$ iterations answer is $$$YES$$$, otherwise we can construct answer as follows: we write remembered letters one by one, after that we add letter, that we lack and until size of our answer $$$ \lt k$$$ we will add letter $$$a$$$ to the end of it. $$$O(nk)$$$ per test.

P.S: Funny, that C is a checker for A.

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

After solving D2A D2B I thought D2D would be easy and got the right answer within O(1), but THIS IS THE FIRST TIME I come across fraction representation like "Calculate p⋅q^−1 mod(10^9+7)" and didn't know how. Also the unreduced denominator can be n^4 which is 10^20 and goes beyond the long long limit. That left me stuck trying python or __int128

:(

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

Problem E basically have the same solution with this atcoder problem ARC114E.

Atcoder

Though it seems this did not affect the standings, as I did not found many others solving this lightning fast. (Not that this particularly affected me as I solved this problem pretty quickly when practicing)

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

    Hi, I thought of the problem after solving the atcoder one and mentioned in the round proposal that my problem is inspired from this one.

    According to me, my solution is very different from the solution of that problem. Only the concept of linearity of expectation is common.

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

      To me, there are two key components of the solutions, aside from linearity of expectation.

      Solution

      With these two key concepts the rest of solution should be basic calculations.

      But by far, the first part is hardest one and take the longest to come up with. Unless the intended solution is very far from what I described then I can see your reasonings.

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

        Yeah my solution is slightly ugly and doesn't use the first concept mentioned by you.

        Informal solution
»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

div2D was one of the easiest problems I've aeen in a while, and yet i spent four tries, first because i summed without modulo, then because i divided by 2 and not multiplied by 2^-1. i should really get a modulo template

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

Here is my advice about the problems (Div 2):

A
B
C
D
E

Anyway, kudos to the authors of the round, it was still an overall good contest

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

When I submit solutions after the contest is over ?

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

Why is this giving memory limit exceeded for Div2,C? 243648118

I even tried using map instead of set, yet ntg changed. 243653296

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

FST on test 24 of B... Please, let me get a huge negative delta then I can farm the next div 3

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

approach for Div2D ??

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

FST Div2B, fail to solve C, endup solve A only

going to buy rope today

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

for DIV2 C

What should be answer for this?

Spoiler

According to me it should be NO. I thought problem states first k lowercase characters.

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

failing System Tests has got to be one of the worst feelings

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

My submission for div.2b got tle on tc 23. Although I had this feeling that it might get tle still I overlooked as it passed the Pretests.

Atleast they could've provided strong pretests :(

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

12 fricking FST's in B in my room which were so easliy hackable 😢
Lesson learnt

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

why test cases are not visible now???

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

My submission 243558996 passed pretests but wasn't evaluated in the final submission. Coordinators, please investigate.

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

Test cases of div-2 B :(

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

Easy and elegant solution for E using only fenwick tree and std::set: https://mirror.codeforces.com/contest/1925/submission/243668425

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

Can anyone tell what is wrong in my submission? https://mirror.codeforces.com/contest/1925/submission/243671686

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

Why this solution doesn't work for Div2C, I've tried to find testcases where it might fail but cant seem to do so. (I know it might TLE I just wanna get the logic right).

https://mirror.codeforces.com/contest/1925/submission/243668507

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

I feel soo good

for the first time i solved a question

and this is where my Journey started...

Lets goo :>

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

As a div.2 participant, I find it very strange, that problem creators decided to leave the link to the wiki page of modular multiplicative inverse in statement of 1925F - Fractal Origami but not for 1925D - Good Trip . I didn't manage to figure out how to restore the answer from rational number, even though i had completely correct solution.

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

What would be the rating of C?

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

Div1D one-liner?

Use the usual interpretation of sequences as walks of $$$(+1, +1)$$$ and $$$(+1, -1)$$$. WLOG $$$n \geq m$$$, then the longest subsequence has length $$$(\min y) + m$$$ (minimum y-value plus down arrows count). Using the well-known catalan reflection argument gives a final answer of $$$\binom{n+m}{k} - \binom{n+m}{k-1}$$$, with an edge case at $$$k \gt \min(m,n)$$$.

243676528

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

Can C be done with DP?

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

I guess people don't like to see what I wrote, and unfortunately I can't delete the comment (no option to do so), Treat this as a DELETED COMMENT.

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

Finally, I could make use of my squared office papers

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

Tilting round :/

A was a good & funny problem. I only got the greedy after thinking through the naive DP over and over and realizing that it can be transformed to greedy.

B, I knew that the problem was basically just this, but it seemed like overkill. Plus, I hadn't actually solved it so I didn't feel like copying somebody else's code. So I over-engineered a terrible set + segtree solution with 5 WA's under my belt B)

C, I literally got the main observation within minutes, and worked out the formula shortly thereafter. Spent 30-40 minutes not being able to implement goddamn complex number arithmetic.

I asked ChatGPT this prompt:

give me a c++ library that supports multiplication, division, addition, and subtraction of numbers represented as a + b*sqrt(2). The underlying type should be a pair of long longs. 

To handle division, we're working over the field 999 999 893 

and it AC'd first try.

For comparison, this was my upsolve: 243684462

and this was ChatGPT's library: 243685245

Lesson of the day? I don't know, massive skill issue :(

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

Hi, my problem B during the System test doesn't test again for the main test. After I woke up this morning, I saw my score had been minus but problem B wasn't in the main test. I tried to submit again with that same code and the code seems to be AC (I didn't get hacked or sth). MikeMirzayanov yash_daga Can you help me please?

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

WHERE IS MY B? ⚈₃⚈

»
2 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится
Fun Fact :)
»
2 года назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

The pretest of B is weak resulting in many people got hacked and fst.

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

243558075 I solved question A, the pretest passed, and didn't get hacked, but the final settlement showed that only BCD was done, A didn't show "Accept",. I then handed over the same code, which was Accept, why?

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

MikeMirzayanov In the last DIV2 921 my submission for C shows pretests passed , but it neither shows AC nor FST on the final standings . Can you please check once . I solved 3 problems but it shows only 2 problem solved . https://mirror.codeforces.com/contest/1925/submission/243641450

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

I've got abrupt rating changes in this round 912 div2. kindly see to this image

yash_daga please solve this issue

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

Simple solution for DIV 2D

        int n, m, k;
        cin >> n >> m >> k;
        int a,b,fi,f = 0;
        for(int i = 0; i < m; i++){
            cin >> a >> b >> fi;
            f+=fi;
            f%=mod;
        }
        int num =( n * (n - 1)/2ll) % mod;
        int sum = ((((k * f) % mod * binexp(num, k - 1)) % mod) + (((k * (k - 1))/2ll % mod * binexp(num, k - 2)) % mod * m) % mod) % mod;
        num = binexp(num, k);
        num = binexp(num, mod - 2);
        sum = ((sum * num) % mod);
        cout << sum << endl;
»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Anyone using sqrt decomposition to solve div2 problem E? I divide the sequence into $$$\lceil\sqrt n\rceil$$$ blocks, with each block at most $$$\lceil\sqrt n\rceil$$$ length (the last block is cutoff to a lower size). Then for each insertion of harbour, I find its left harbour $$$l$$$ and right harbour $$$r$$$ and then update the blocks in $$$[l,r]$$$; for each query $$$[l,r]$$$, I also retrieve the information in blocks in $$$[l,r]$$$. I think it should cost $$$O(q\sqrt n)$$$ and should get passed. However I got time limit exceeded: https://mirror.codeforces.com/contest/1925/submission/243770890. Could anyone help?

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

The fact that X was not sorted in B is pure evil. Why would anyone create and approve such a version?

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

can someone tell me in which test case my code is failing?

void solve(){

int n,k,m;
cin>>n>>k>>m;
string s;
cin>>s;
int a[k]={0};
for(int i=0;i<m;i++){
    a[s[i]-'a']++;
}
for(int i=0;i<k;i++){
    if(a[i]<n){
        cout<<"NO"<<endl;
        for(int j=0;j<n;j++){
            cout<<char('a'+i);
        }
        cout<<endl;
        return;
    } 
}
vector<int>b(k,0);
for(int i=0;i<m;i++){

        int c=s[i]-'a';
        b[c]++;
        a[c]--;
        for(int j=0;j<k;j++){
            if(a[j]<(n-b[c])){
                // cout<<j<<" "<<c<<endl;
                cout<<"NO"<<endl;
                for(int idx=0;idx<b[c];idx++){
                    cout<<char('a'+c);
                }
                for(int idx=0;idx<n-b[c];idx++){
                    cout<<char('a'+j);
                }
                cout<<endl;
                return;
            }
        }

}
cout<<"YES"<<endl;
»
2 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

maybe sample of div1F should be t=2 yash_daga

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

Hey folks, here is the solution video to the problems A to E (Div 2) of the above contest for those of you who'd like to upsolve them or reflect upon alternative techniques to solution etc. The video stresses upon the intuitions to solve the problems mostly from scratch. I believe this will benefit budding CPers who're trying to level up, and it shall inspire them to do better in upcoming contests. I'll try to consistently post videos on some of the upcoming contests and would be excited to see the community grow together! See you all! Feel free to write to me about any doubts/issues/feedback. Thanks!