### vrintle's blog

By vrintle, 3 months ago,

Thanks to the whole Codeforces community & MikeMirzayanov!

• +304

By vrintle, history, 7 months ago,

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

• -2

By vrintle, history, 8 months ago,

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

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.

• -34

By vrintle, history, 15 months ago,

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?

• +5

By vrintle, history, 21 month(s) ago,

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).

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

• -18

By vrintle, history, 22 months ago,

Hello everyone!

Here is the link to the problem: https://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?

• -22

By vrintle, 22 months ago,

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.

• -3