Proof_by_QED's blog

By Proof_by_QED, history, 5 days ago, In English
Rating Predictions

2065A - Skibidus and Amog'u

Problem Credits: chromate00
Analysis: macaquedev

Solution
Code
Rate The Problem!

2065B - Skibidus and Ohio

Problem Credits: cry
Analysis: macaquedev

Solution
Code
Rate The Problem!

2065C1 - Skibidus and Fanum Tax (easy version) and 2065C2 - Skibidus and Fanum Tax (hard version)

Problem Credits: larush
Analysis: macaquedev

Solution
Code
Rate The Problem! (C1)
Rate The Problem! (C2)

2065D - Skibidus and Sigma

Problem Credits: cry
Analysis: macaquedev

Solution
Code
Rate The Problem!

2065E - Skibidus and Rizz

Problem Credits: Proof_by_QED
Analysis: macaquedev

Solution
Code
Rate The Problem!

2065F - Skibidus and Slay

Problem Credits: chromate00
Analysis: chromate00

Solution 1
Solution 2 (Skibidi)
Code
Rate The Problem!

2065G - Skibidus and Capping

Problem Credits: larush
Analysis: Proof_by_QED

Solution
Code
Rate The Problem!

2065H - Bro Thinks He's Him

Problem Credits: Proof_by_QED
Analysis: efishel

Solution
Code
Rate The Problem!
  • Vote: I like it
  • +29
  • Vote: I do not like it

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

First time I tried competing in Rust. Hopefully next time will go better. Thanks for the round!

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

    ++

    • »
      »
      »
      8 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      thats great

  • »
    »
    4 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Do you recommend it?

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

Auto comment: topic has been updated by Proof_by_QED (previous revision, new revision, compare).

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

That was not Div4......

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

    what was it then

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

      bro last div 3 was easier than wtv this div 4 was

      • »
        »
        »
        »
        16 hours ago, # ^ |
          Vote: I like it +10 Vote: I do not like it

        How so? I think F and G in round 998 were quite difficult, and far more than any problem in this problemset.

»
20 hours ago, # |
  Vote: I like it +63 Vote: I do not like it

I'm sure exactly zero people used the Auxillary Tree method to solve F.

  • »
    »
    20 hours ago, # ^ |
      Vote: I like it +18 Vote: I do not like it

    Even after reading the tutorial, I have no idea what an Auxiliary Tree is.

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

      what is that thing

    • »
      »
      »
      19 hours ago, # ^ |
        Vote: I like it +11 Vote: I do not like it

      it's also known as a virtual tree if i'm not wrong

  • »
    »
    19 hours ago, # ^ |
      Vote: I like it +9 Vote: I do not like it

    It was originally in the statement :) (notes to be precise)

    It doesnt make much sense in the editorial indeed.

  • »
    »
    12 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It'll be fun to research though lol

»
20 hours ago, # |
  Vote: I like it -12 Vote: I do not like it

Problems really weren't newbie-friendly. The problems are excellent, but not for Div.4 contest. More like Div.3 — Div.2

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

    This was my first ever competition other than the one i gave previously. First Div 4 competition. And the first and second problem were i mean pretty easy. The third problem was tough though i was able to solve it.

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

Hope there are no more GPT or any AI during future contests.

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

    so true. There is no way so many pupils and newbies can solve beyond E and F without cheating

  • »
    »
    31 minute(s) ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    hahaha yes, during the break-ins, guys with a rating of <1200 are in the top 200 and comments on every line in the code XD

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

I've been struggling for more than an hour to optimize Problem G, but I haven't been able to succeed.

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

pls tell me i'm not the only one that used LCA to AC F.

»
19 hours ago, # |
Rev. 5   Vote: I like it +16 Vote: I do not like it

Alternative solution for H:

Make a segment tree, and in each node, place the following things:

  • The length of the segment (call it $$$l$$$);

  • The number of subsequences with each start and end (call it $$$C_{i,j}$$$);

  • And the number of non-equal adjacent elements across all subsequences (call it $$$ans$$$).

We can find $$$ans$$$ in the following way: either the adjacent elements are both in the left, both in the right, or one's in the left and the other is on the right. So it's gonna be

$$$left_{ans} \cdot 2^{right_{len}} + right_{ans} \cdot 2^{left_{len}} + \sum_{0 \le i,j,k,l \le 1, j \neq k} left_{C_{i,j}} \cdot right_{C_{k,l}}$$$

.

This is what the code looks like: 305334877

»
19 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Can someone please explain why two pointer does not work in Problem C2 after sorting array b?

  • »
    »
    19 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Because a is not sorted, so while you move the first pointer forward the second pointer may move backward, then forward, then backward and so on. The solution's time complexity will be no better than O(n^2).

»
18 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

F is a very interesting question. It could've been set in a Div 2 or 3.

»
18 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Could someone please explain why my submission for C1 is wrong?

https://codeforces.net/contest/2065/submission/305319973 (ignore "printDiffs" and "brute" functions, I used those for debugging)

I tried figuring it out but couldn't find what I did incorrectly...

  • »
    »
    15 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Think about what you should do if a[i — 1] > a[i] is not true (i.e.: a[i — 1] <= a[i]). Are there any cases where it would be beneficial to perform the operation in that case?

»
17 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

could C1 also be solved using masks? 305285624 if yes, why doesn't this work ?

»
17 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

I liked problem D. never used prefix sums like that before. Very interesting contest overall :D (A little too much brainrot for me tho). Also I was curious if using DFS/BFS is a good idea in problem F. It might be redundant, but if anyone solved with bfs/dfs, please share your solution.

  • »
    »
    10 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I solved using BFS,created a map for adjacent elements for each node in the tree ...305322643..hope you like it :D

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

      Yep. That's literally what I wanted! Thank you kind sir.

»
16 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Problems were defo not sorted according to difficulty, D was much easier than C1C2 combined! I had to do a very weird sorting pref sum thing just to solve it bcz i thought sorting according to sum was too easy,AC is AC lhamdoullah but still D shouldve been put before C

»
16 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Can anyone tell me where this solution for problem G might be going wrong
I believe, I did it similar to the approach given in editorial

  • »
    »
    12 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Seems that your code give WA in large cases only. When $$$n \ge 460$$$ your code print a lower answer that the expected. Like, your output is for example 4098 and the correct answer is 108219. Maybe you aren't counting some semi-primes or primes.

»
16 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Can someone pls help with F problem. I have maintained a neighboring frequency map and just checking if frequency > 1 for some element.

https://codeforces.net/contest/2065/submission/305373353

»
15 hours ago, # |
  Vote: I like it +3 Vote: I do not like it

2065D - Skibidus and Sigma Editorial

Sort each array in decreasing order. Sort the arrays themselves in terms of their sum, from largest sum to smallest Put together the final array Take the score This score is guaranteed to be maximal.

Bolded part is a mistake?

»
15 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Can someone please help on what mistake I'm making for Problem G,

My submission

Thank you so so much!!

  • »
    »
    12 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Maybe your code is getting TLE because of this line:

    vector<ll> freq(2e5+5, 0);
    

    You are allocating $$$2 \cdot 10^5$$$ for each test case $$$t$$$ ($$$t \le 10^4$$$), this is like $$$2 \cdot 10^9$$$ causing the TLE. The statement says that: It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\cdot 10^5$$$.

    If you replace 2e5+5 to n+5 you'll get an AC. 305391811

»
9 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Problem G https://codeforces.net/contest/2065/submission/305402634 Can someone please tell me what i am doing wrong I am wrong answer on 4th case

»
8 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Brainrot Question names

»
8 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Why my O(16 * n * logn) solution on H got tle :(

»
7 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

why this contest (DIV-4) rating is not updated...

  • »
    »
    7 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Due to large number of participation + long hacking phase + A lot of cheaters

    It takes time to asses and declare the final leaderboard, Its better to wait and get honest rating than to see cheaters getting +400 above you.

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

can somebody tell me at what test case my code might be failing 305361698

  • »
    »
    6 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    PLZ Somebody help me with this

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

      Nevermind sorry, the advice I gave earlier is for C2.

      I looked through your code. I would try to make sure of two things:

      1. It seems like when you shift the one in front (d[i + 1] = 1), you then set the next one to always enter the first part of the for loop. In other words, in your code, I think once you flip one in front, it always flips the one in front regardless of whether or not it should. Always check, in your code, that every flip you do decreases or increases the number if it is expected to do that. It is a bit hard to tell what the d array is used for, it seems to be telling whether or not a bit is able to be flipped but is interacting with the ones in front, which haven't been checked yet?

      2. Make sure your code is not O(n^2) time complexity. I think your funci() and funi() functions are O(N), and if these run on every index, you might get a time limit problem because doing this on every index is O(n^2). I am not 100% sure of this.

      Sorry for the initial wrong example/

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

Question H's tutorial has faulty LaTeX in the "Solution" section near the bottom. In the last math's pseudocode, there's some oplus1 thing. I think it's just supposed to be s[j] XOR 1.

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

    $$$\oplus$$$ represents $$$\oplus$$$ (XOR).

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

CAN ANYONE EXPLAIN WHY THIS APPROACH TO c WAS WRONG?

https://codeforces.net/contest/2065/submission/305299896

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

    we need something greater than prev( i.e, a[i-1]) in the ith position. two options: a[i] and someB-a[i].

    how do we find someB such that someB — a[i] >= a[i-1]? binary search for someB >= a[i-1] + a[i].

    However, your binary search looks for the incorrect equation.

    • »
      »
      »
      4 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      oh nevermind I misread your equation.

      • »
        »
        »
        »
        4 hours ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Okay, you are not considering a[i] as a better alternative to the binary searched someB — a[i]. Since the question says we have two options but you seem to be consider a[i] assignment as directly someB — a[i] instead of picking the minimum of the two options if someB is found.

»
4 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Does anyone tell me why my O(16 * n * logn) solution on H was TLE ? I read William Lin's solution and it may the same with mine

Here is my solution https://codeforces.net/contest/2065/submission/305249433

Here is William Lin's solution https://codeforces.net/contest/2065/submission/305272835

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

Lol I didn't solved B. after 1st wrong submission big mistake

»
47 minutes ago, # |
  Vote: I like it 0 Vote: I do not like it

I’m working on problem C2 and I’m unsure where my code is going wrong. Could anyone help me figure it out?

void solve () {
    int n,m;
    cin>>n>>m;
    vector<int>a(n),b(m);
    for (int i=0;i<n;i++) cin>>a[i];
    for (int i=0;i<m;i++) cin>>b[i];
    sort(b.begin(),b.end());
    a[0] = (b[0]- a[0]) < a[0] ? b[0]- a[0] : a[0];
    for (int i=1;i<n;i++) {
        int ind = lower_bound(b.begin(),b.end(),a[i-1]+a[i]) - b.begin();
        if (ind < m && b[ind] - a[i] <= a[i] && b[ind] - a[i]>= a[i-1]) {
            a[i] = b[ind] - a[i];
        }
        if (!(a[i] >= a[i-1])) {
            cout<<"NO"<<"\n";return;
        }
    }
    cout<<"yes"<<"\n";
    return;
}


int main()
{
    int ct ;cin>>ct;
    while(ct--)
    {
        solve();
    }
    return 0;
}

  • »
    »
    37 minutes ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You're only applying the operation when you get a shorter element compared to current one. But this is not always true.

    Consider the case:

    a = [6, 4] b = [1000]

    You won't apply the operation on 4, because it would be substituted to > 4(1000 -4), but if you've used that you should've got a non-decreasing array.