### HealthyUG's blog

By HealthyUG, 6 weeks ago,

Ever since CF introduced streams, a lot of CPers have become streamers, and even before that some youtubers were making CF contest editorials or screencasts, like SecondThread, Errichto, galen_colin, myself and maybe some more.

Now there are a lot more of such people. But I've seen(from my video stats mainly), that the editorial videos kinda get lost after 3~4 days.

If CF supported an option to include video editorials on the problem/contest page itself, then the videos would become "immortal" and help people even after like 5 years from now.

Therefore, I request people at HQ to look into this. Also, to ensure quality, this edit access can be restricted similar to contest materials/streams sidebar, if needed.

• +6

By HealthyUG, history, 3 months ago,

When I submit a problem from the problemset, I see the status with "my only" enabled(That is, I only see my own submissions). But from there if I try to go to the second or third page, then the "my only" flag gets auto disabled and I start seeing everyone's submissions.

I believe the bug must be easy to fix as the only mistake is that ?my=on should be present in the links that take us to other pages of the status.

The issue

• +134

By HealthyUG, 3 months ago,

So I did a poll on my channel for choosing the topic and welllllll...

I LOVE DEMOCRACY
So anyway... The topic is Medium Level Graph Problems! Here is a mashup full of such problems. You guys have 4 days to attempt it before I stream it on YouTube. You guys can solve it at whatever speed you're comfortable.
Why?

The mashup is full of problems that I haven't seen yet. I asked my talented college junior CoderAnshu to create the mashup. The problems are handpicked by him. The problem difficulties are roughly in the 1700 to 2000 range and they are sorted according to difficulty.

Why didn't I make the mashup myself?

Here is the link to the mashup(also a little surprise waiting there): CwD Educational Graph Mashup

Go start solving the mashup now!

Comment below if there's any issue with the mashup or if you have any suggestions regarding anything!

love, me, like, you,

• +159

By HealthyUG, history, 3 months ago,

As some of you might already know, I have a youtube channel on which I do CP related content in my regional language. Long story short... I became red recently and now I can put content in the CF sidebar so I'll be doing English Streams now.

The first stream will take place sometime next week. (I'll post the exact time soon).

The idea of the stream is primarily inspired(read:stolen) from galen_colin's topic stream idea.

So I have a poll on my channel for deciding the topic. If you're interested do check it out and cast your vote. (The fifth option was just a joke PLZ PLZ don't vote for that).

If you have any suggestions you can comment them here or on the channel... Thank you!

• +152

By HealthyUG, 4 months ago,

I have a youtube channel on which I mainly do Hindi content and I had plans to do some Hindi live streams. Now I'm wondering is it ok if I embed them to CF because I became red yesterday and now this feature is available to me.

I know that it won't be relevant to a lot of people because of not being in English, that's why I'm asking before posting it there. Is it ok if I post about non-english streams?

• +130

By HealthyUG, history, 7 months ago,

Here's my (attempt at a) video solution of the all problems from yesterday's div 2 contest.

https://youtu.be/elOYwIx1fAM

(Fortunately there weren't many prerequisites for today's problems so it all went fine.)

I skipped the code because it would've taken very long, just explained the problems well. Do share your thoughts and opinions by commenting here (or on the video).

PS: I missed getting to red by 4 rating :(((

• +48

By HealthyUG, history, 7 months ago,

EDIT: As I'll be posting a lot of videos in this series, instead of writing a separate blog everytime, I'll just keep on adding the links on this blog itself

Here are the links of the videos currently available in the DP playlist on my channel.

I'll add the remaining editorials soon, keep checking the blog regularly if you're interested. Also do give me suggestions, if you want such series on some other topic.

If you have any doubts/feedback/suggestions, comment them here or on the youtube video.

Original Text of the blog:-

• +78

By HealthyUG, history, 8 months ago,

LATEST EDIT: The channel is created, read more in my new blog.

EDIT: I have decided I'm going to start the channel. If you want videos on some specific topics or editorials of some famous questions, please mention them in the comment section below.

Hello everyone,

I see a lot of content in russian or chinese language that gets translated or rewritten in english and then it gets introduced to the world. I believe that in my country (India), there are people who aren't very familiar with English either. I actually know a few people who are sometimes unable to understand blogs and editorials because of being weak in English. Even some of the people who understand English pretty well might feel more comfortable with Hindi.

Now I know that English is a pretty standard language and people should be good at it, but I still believe that Hindi videos would actually be helpful to some people, although I'm not very sure, that's why I wrote this blog.

Should I start a youtube channel in which I make videos about algorithms and/or problem solutions in Hindi? I have a few nice topics in mind.

• +162

By HealthyUG, history, 11 months ago,

I was implementing a Trie for Google Kickstart earlier today and the code is malfunctioning in a very strange way. I have no idea why this is happening. I narrowed down the problem in a few hours.

#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b)        for(int i=a;i<b;i++)

struct node{
int ends=0;
int child[26]={0};
};

vector<node> trie;
int makenode(){
trie.push_back(node());
int x=(int)trie.size() - 1;
cout<<x<<" ";
return x;
}

void insert(string &s,int root=0,int pos=0){
if(pos==(int)(s.size())){
trie[root].ends++;
return;
}
int next=s[pos]-'A';
if(!trie[root].child[next]){
// trie.push_back(node()); trie[root].child[next]=(int)trie.size()-1;    //THIS LINE WORKS FINE
trie[root].child[next]=makenode();
cout<<trie[root].child[next]<<"\n";
}
insert(s,trie[root].child[next],pos+1);
}

int main(){
trie.clear();
trie.push_back(node());
string s;
cin>>s;
insert(s);
return 0;
}


The function makenode() returns x. When I print x, the values are fine but after returning the values are getting changed.

One would expect the above code to print the same integers per line but the values aren't same.

These are the values of x before and after returning from the function makenode().

Does anybody have any idea why this is happening?

(I have noticed that only the values 1,2,4,8,16,32,etc are wrong)

• +29

By HealthyUG, history, 11 months ago,

There's another simple greedy solution to the problem using dfs trees.

First form a dfs tree of the graph with any vertex as its root. Now consider a vertex $P$ which has a backedge to vertex $Q$, if $depth(P)-depth(Q)+1 >= \lceil\sqrt{n}\rceil$ then we have found a cycle of at least $\lceil\sqrt{n}\rceil$ vertices.

If we cannot find such a cycle, we'll find an independent set, we know that the leaves of a dfs tree do not have an edge between them. So we'll take all the leaves in the independent set. But that may not be enough we need more vertices, so we'll choose each such vertex whose depth is at least $\left(\lceil\sqrt{n}\rceil - 1\right)$ less than the minimum depth of all the chosen vertices in it's subtree and insert it to the independent set (we can do so because if there is an edge between the current vertex and any of the previously chosen vertices, we would have found a cycle). How can we say that such an independent set will have at least $\lceil\sqrt{n}\rceil$ vertices? Here is an intuitive proof:-

Consider any linear chain in the dfs tree of length $L$ which terminates at a single leaf, we can pick $\lceil\frac{L}{\sqrt{n}}\rceil$ vertices from this chain. Whenever we put a vertex in the independent set, we can disconnect its entire subtree from the graph and consider it as a new leaf. After this we can select any other linear chain and repeat this process.

In total, we'll have $\sum{\lceil\frac{L}{\sqrt{n}}\rceil}$ vertices in our independent set which is at least $\lceil\frac{n}{\sqrt{n}}\rceil = \lceil\sqrt{n}\rceil$ (since $\sum{L} = n$).

I'd appreciate if someone can come up with a more concrete proof.

Here is my accepted solution: https://codeforces.com/contest/1325/submission/73328247