vrintle's blog

By vrintle, history, 11 months ago, In English

Hello, Codeforces!

I and tanmaytaneja2 have curated a Solo Practice Contest in the gym, Coding Challenge Alpha IV — by AlgoRave. This is for anyone who loves giving contests and solving problems. This contest will be of most interest upto Expert rated coders, but I would also invite Div. 1 coders to participate as well. For anyone who wants to practice or just wants to go through the problems can register for our contest. Hope you guys will enjoy solving the problems!

I would like to thank:

A special thanks to 0x4F5F6F for co-ordinating the round.

Contest Details:

Good Luck and Have Fun!

Spoiler

Note: You can also register for the contest while it is going on. You may want to check out our group for past contests.

UPD: Congratulations to the winners!

  1. cuiaoxiang
  2. Tobo
  3. muhammadhasan01
  4. kachhuaa
  5. WORTH

Congratulations to first solves as well!

A: pattagobhii
B: cuiaoxiang
C: 18o3
D: cuiaoxiang
E: tvmpqx_8601
F: Tobo

UPD 2: The gym contest has been made private in order to view failed testcases and submissions to everyone. Please use the contest invite (given above) to access it or you can also join our codeforces group by this link to view all the contests.

UPD 3: Editorial is out!

Full text and comments »

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

By vrintle, 2 years ago, In English

Thanks to the whole Codeforces community & MikeMirzayanov!

Full text and comments »

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

By vrintle, history, 2 years ago, In English

As there is no official announcement blog for September Easy '22, so I made this.

Full text and comments »

  • Vote: I like it
  • -2
  • Vote: I do not like it

By vrintle, history, 2 years ago, In English

We have Biweekly Contest and CF #812, both on Saturday at the same time. And, then we don't have any contests (as of now) till 10th August.

So I think it would be nice to shift CF #812 on Sunday, to let us enjoy both contests in the weekend.

Support the petition here: https://chng.it/4pPN4c9b

Why downvotes guys ?

I think it's a valid petition, because this Sunday we have no contests, and I realised this after Cook-off disappeared from CodeChef contests list, few days ago. Downvoting this blog will remove this from recent actions, which will not be helpful for anyone.

So, please vote this up so that it can at least come up in recent actions.

Full text and comments »

  • Vote: I like it
  • -34
  • Vote: I do not like it

By vrintle, history, 3 years ago, In English

Problem: https://mirror.codeforces.com/problemset/problem/431/C

I started solving this one by thinking a $$$DP[sum][level]$$$ state, which means ways to achieve a given sum on a given level, and the maximum number occurring in the sum. And, I coded its recurrence similar to subset sum as,

vector<vector<pair<ll,ll>>> dp(n+1, vector<pair<ll,ll>>(n+1, { 0, 0 })); 
// dp[i][l]: sum i at level l, { ways, max }
dp[0][0] = { 1, 0 };

for(ll i = 1; i <= n; i++) { // level
  for(ll j = 1; j <= k; j++) { // number
    for(ll s = n; s-j >= 0; s--) { // sum
      if(dp[s-j][i-1].first > 0) {
        // j is added to s-j sum from prev level, making a sum of s in the curr level
        dp[s][i].first = (dp[s][i].first + dp[s-j][i-1].first) % M;
        // adjusting the max of curr level with j
        dp[s][i].second = max(j, dp[s-j][i-1].second);
      }
    }
  }
}

And, after computing the required DP states, I am adding the ways of making sum $$$n$$$ from each level $$$i$$$, when $$$max >= d$$$ as,

ll ans = 0;
for(ll i = 1; i <= n; i++) {
  if(dp[n][i].second >= d) ans = (ans + dp[n][i].first) % M;
}
cout << ans;

For some reasons, this is giving wrong answer verdict on test 5, can anyone kindly explain me why it is incorrect and how to improve it?

Submission link: https://mirror.codeforces.com/contest/431/submission/138596746

Full text and comments »

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

By vrintle, history, 3 years ago, In English

I was just reading some recent blogs, and out of interest I saw ratings of OptimusPrime090, the graph took a wild spike in the last contest (#727), and when I explored more into his recent contests, I found that he had got a rank of 1k by solving 0 problems!!! (whereas I got 2417 in the same).

strange-strange-things-on-CF

Is this a bug or something else I'm confusing with, as it looks very strange to me!

Full text and comments »

  • Vote: I like it
  • -18
  • Vote: I do not like it

By vrintle, history, 4 years ago, In English

Hello everyone!

Here is the link to the problem: https://mirror.codeforces.com/contest/1504/problem/B

In the 5th test case, $$$A$$$ can be converted to $$$B$$$ as:

000111 -> [000111] -> 111000
111000 -> 11[10]00 -> 110100

As, both the prefix contains equal $$$1$$$ and $$$0$$$, so I think this is correct. But, the answer says, it is impossible to convert $$$A$$$ to $$$B$$$. Why?

Full text and comments »

  • Vote: I like it
  • -22
  • Vote: I do not like it

By vrintle, 4 years ago, In English

Hello everyone!

The following is my submission to Problem F1 — Guess the K-th Zero (Easy version)

118290089

It is showing me TLE, whereas when I run it locally, it passes the test case. I have also cross-checked my loops, but found nothing suspicious. I guess my logic is a bit different from others, but I will later work on that, firstly I want to know the reason for TLE.

Full text and comments »

  • Vote: I like it
  • -3
  • Vote: I do not like it