coderdhanraj's blog

By coderdhanraj, 6 weeks ago,

Hey Everyone!

First of all, "Merry Christmas" and "Happy New Year" to all, hope you all would be doing good :)

Hack #1: Fix Background for Dark Reader

As codeforces's looks gets changed between christmas and new year's eves so due to change in background some of us who use dark reader or any dark themes would be facing issues while exploring codeforces.

like this :(

So if you facing the same issue you may do following to get the following result :)

like this :)

You just need to add the following code to dev tool of "Dark Reader" for "codeforces.com" under "CSS".

body{
background:url(..) !important;
}

Hack #2: Remove/Hide Tags for Codeforces Problems

As you would have to download any additional extension to hide the tags. Or you may be disabling the tags for unsolved problems via codeforces settings(but once a problem get solved tags get visible!).

So to remove problem tags. Add the following code to dev tool of "Dark Reader" for "codeforces.com" under "CSS".

.tag-box{
display:none;
}

If you want to see the problem difficuly(rating) only, then add the following code as well!

span[title="Difficulty"]{
display:block;
}

Hack #3: Be pro on codechef (Remove the pro banners on codechef)

Before
After

You just need to add the following code to dev tool of "Dark Reader" for "codechef.com" under "CSS". to be pro XD.

.special-block-img-container,
.m-premium-text-container{
display:none;
}

Hack #4: Upto you :)

Similarly above you may change styling of a website to get the desired result :3

If you find this blog useful then press the green triangle :)

• +46

By coderdhanraj, 5 months ago,

Hey Everyone!

Hope you all would be doing great! I recently was exploring some codeforces chrome extensions and I came across following underrated extensions which are not that famous but they are pretty much useful.

• Coding Shout (It gives a message stating verdict of your current submission) it's pretty much useful as during a contest we usually don't want to stay on 'my submission page' to get the verdict.

• CF GetRating (It hides the tags and shows only the problem difficulty) it's pretty much useful during practice as we don't want to see the tags but want to get an idea of problem difficulty.

• CF Tracker (It's a kind of stopwatch which may help in practice to speed up)

If there are more useful extensions do let me know in the comments I will add those in the blog. :)

PS: I got a working userscript for Multirating graph here (work like this).

• +15

By coderdhanraj, 5 months ago,

Hey Everyone,

I am stuck on the following problem. Need help!

Problem: Unique Paths (Hard Version)

You are given a grid consisting of $n$ rows and $m$ columns. There are two types of cells good and bad. You can't move in a bad cell. There are $k$ bad cells in the grid.

You can move only in the right and down direction only. i.e. if you are on cell $(i, j)$, so you can move to $(i + 1, j)$ and $(i, j + 1)$.

You are asked to find the no of ways or no of unique paths to reach cell $(n, m)$ from cell $(1, 1)$. As the answer can be large print it modulo ${10^9 + 7}$.

Constraints:

${1 \le n, m\le 10^5}$, ${0 \le k \le min(10^3, n * m).}$

Sample Example

n = 5, m = 5, k = 2.

bad cells = (1, 2), (3, 3).

answer = 17.

• +1

By coderdhanraj, 6 months ago,

Hey Everyone!, I was trying this problem with Matrix Exponential as I got a recurrence relation of ${f_k = f_{k-9} + f_{k-10}}$.

I am unable to speed up the matrix exponentiation as it's gonna be ${O(10^3 * log k)}$ to get Matrix $M_{10 * 10}^k$ to get $f_k$.

Can anyone tell me some optimizations to get $f_k$ faster?

• +6

By coderdhanraj, 6 months ago,

Hey Everyone,

Recently, I had my Salesforces Coding Test and I got 3 problems in which I solved 2 problems fully and solved the following problem partially with $O(n * m * m)$ using DP. Can anyone tell me the $O(n)$ approach for this problem?

Problem : Bob and Problems

Bob and Alice are preparing $n$ problems for Hackerrank. [n-problem together can be considered as 1 problem-set]

The hardness level of the problem $i$ will be an integer $a_i$, where $a_i \ge 0.$

The hardness of the problems in a given problem-set must satisfy $a_i + a_{i + 1} < m$, and $a_1 + a_n < m$, where $m$ is a fixed integer.

Bob wants to know how many different problem-set are possible. And since this number can be huge, he wants Alice to find it under modulo $998244353$.

Note :

1. Two problem-sets of difficulty $a$ and $b$ are different only if there is an integer $j$ ($1 \le i \le n$) satisfying $a_i \neq a_j$.

2. You can choose $a_i$ as any integer greater than or equal to $0$, as long as it satisfies the constraints on line-3.

Constrains :

$2 \le n \le 10^5$, $1 \le m \le 10^9$

Sample Test Case :

Input : 3 2

Output : 4

Explanation :

The valid different problem-sets are [0, 0, 0], [0, 0, 1], [0, 1, 0], [1, 0, 0].

[1, 0, 1] is invalid since $a_1 + a_n \ge m$ here.

• +9

By coderdhanraj, history, 7 months ago,

Hey Everyone,

Hope you all doing well, as we all know Codeforces is one of the best sites on the internet. I would like to suggest some features if codeforces can add then codeforces would become way better.

• Hide Tags but show problem difficulty/rating option.
• A rated/unrated registration policy. [I have seen this feature on atcoder.jp]
• A streak ranking leaderboard (shows the coders having highest streak). [I have seen this feature on kenkooo.com]
• An official dark theme.
• Score distribution for gym/mashups contests, same as we see in a Div2/Div1/Global rounds.

These are just my personal suggestions. What additional feature would you suggest?

• +102

By coderdhanraj, 8 months ago,

Hey everyone! I recently learned Binay-Lifting and found a problem Tree Number Generator. I am getting WA on 5th test case but I am unable to see the test case because it's disabled, here is my code.

Can anyone help me finding the counter-case for my submission or letting me know where I am doing wrong.

Thanks in Advanced :)

• 0

By coderdhanraj, history, 15 months ago,

Hello Everyone!!

I will be making mashups daily in this group so that everyone can practice improving their problem-solving skills. The contests would be consist of 8 problems and two and half an hour [150 minutes] to solve them for now and having an 800-1500 rating difficulties, would be increasing with time. I will also be making some topic-wise mashups every week (e.g. Binary Search, Bitmasking, Graphs, Dynamic Programming. etc) so that those who are weak in these topics can improve it and those who are good at it, can make their speed.

In the group, there would be an overall leaderboard (IFMO typed) (containing all occurred contests scores) so that a better competitive environment exists.

The overall Leaderboard Sample can be shown below:

Anyone can join this group to participate in daily contests (mashups).

I will be waiting to see many participants in today's contest. Daily contests would be at 20:05 UTC, when a clash occurs with any real contest then the practice contest would not occur on that day.

Thank you.

• +35