### vsanjay_nitdgp's blog

By vsanjay_nitdgp, history, 4 years ago, ,

Here, we share our doubts,problems.

Recently, Our group members had a chat and we made up a nice idea that would help every newbie to push up his preparation for ACM-ICPC.

We made list of all important topics for ACM-ICPC,and this is how it works:-

• Either 1 or 2 members of the group make contest on a particular topic(problems may be from different websites) which is divided into 2 days.
• First day problem set would be with easy,medium problems..
• Second day,it would be tough.
• Later after the contest,we discuss them in the group.

Fine,

This is how it is going to work.So,we would like to invite you for our first contest on the concept of binary search

Here is the link(day 1):- — https://www.hackerrank.com/codeforces-training-series-1-day-1-binary-search-tree

Thanks, Happy coding.

Regards, codeforces training series.

• +9

By vsanjay_nitdgp, history, 4 years ago, ,

Hi Coders :)-_

I wanna help all aspiring coders through this  "TRAINING SERIES" blog post.I will be posting problems from various sources topic wise along with clear cut hints,so that it would be easy for those who couldn't come up with AC solution.

Also,Important resources,blogs would updated frequently in this post.Also,any kind of doubts to the problems which are to be posted in this post would be cleared with in 1-2 days.

I hope this would help many coders.So,i want your support to continue updating this post with your UPVOTES.

Thanks,,

Hope you will support our work which is useful for many.

"We will start updating this blog from this week."

NOTE: Also i would like to know your suggestions like,what else should be updated frequently in this post which would also be useful.Comment your suggestions down there.

FACEBOOK GROUP ON THIS "TRAINING SERIES";-(UPDATES OF THIS POST WILL BE NOTIFIED IN THIS GROUP)

Link to my blog(uva codes):- https://codersanjay.wordpress.com/

• +36

By vsanjay_nitdgp, history, 4 years ago, ,

Recently,I solved a problem.

This is one of my step in my solution:

ans=ans-(2*b*c[n]);


ans is double variable,b is integer,c[n] is double; my answer was judged wrong.

when i changed the step to

double p=2*b*c[i];
ans=ans-p;


My solution got ACCEPTED.Could anyone say,why this occur,so that it would be very helpful for future problems of this kind.

Thanks.

• -21

By vsanjay_nitdgp, history, 4 years ago, ,

could any one post code for the followong question.

PROBLEM :F ,GYM

• -8

By vsanjay_nitdgp, history, 4 years ago, ,

Hello,

could anyone provide good source for understand and solving GSS1 of spoj.

• 0

By vsanjay_nitdgp, history, 4 years ago, ,

Could anyone please explain the logic behind this problem.

• 0

By vsanjay_nitdgp, history, 4 years ago, ,

could you please say the idea fo this problem in DISJOINT SET UNION.

Thank you.

• -12

By vsanjay_nitdgp, history, 4 years ago, ,

Hello sir/mam,

i am an aspirant for being a RED coder.i work hard.i just solve problems every day and learn concepts if needed.

But,i want to know from successful coders,what are the resourses that are very useful to become RED coder,

i mean,resoures like:

1.Books
2.Online courses.
3.Any online resourses.

Thank you,

YOUR'S SINCERELY
SANJAY.

• -25

By vsanjay_nitdgp, history, 4 years ago, ,

hello, Recently i was solving this problem below: http://codeforces.com/contest/540/problem/E

I made a survey in my college.Many couldn't do it.I have shown them EDITORIAL too.But many couldn't understand how to solve that finally.Many were confused in a lot ways.

So,Today i request GUYS who solved this problem,to spare some time on this QUERY which would be useful for many students who are breaking their heads on this problem's logic.

Please spare time and post nice explaination with example,so that it would be more clear.

AND i REQUEST not to give DOWNVOTE this post,Because this post is REALLY USEFUL for many CODERS....Many get stuck in this kind of problems,,and due to (some not better explaination)..they skip that problem having good concept...

SO,GUYS PLEASE POST NICE EXPLAINATION FOR THIS PROBLEM,,,

NOTE:IT IS NOT NEEDED THAT YOU UPVOTE THIS POST(BUT DONT DOWN VOTE).......WE NEED TO LEARN CONCEPT...

THANKS IN ADVANCE....HOPE I WOULD SEE MANY REPLIES HELPING MANY CODERS WHO FEEL THIS CONCEPT HARD....

• -26

By vsanjay_nitdgp, history, 4 years ago, ,

Recently,i was solving the following problem: http://codeforces.com/problemset/problem/540/E

the following is the solution i am trying to understand: http://ideone.com/cKjRNr

In the last loop of solution there are two terms,1 is to find difference of initial and final position of that element.

what about second term.according to editorial ,second term is to delete the inversions that were already counted.

so,could any one help how did we get "num[i]-i" as our second term,,whats the proof behind it..

• 0

By vsanjay_nitdgp, history, 4 years ago, ,

SIR/MAM,'

TODAY I WAS SOLVING THIS QUESTION,,

HERE IS MY SUBMISSION.. >> http://codeforces.com/contest/199/submission/13427391 <<

I GOT WRONG ANSWER IN 84th TEST CASE FOR THIS PROBLEM >> http://codeforces.com/contest/199/problem/D <<

THANK YOU..

• -22

By vsanjay_nitdgp, history, 4 years ago, ,

good day sir, Today i was solving this problem,and got stuck,thinking what is the logic of the below problem.

https://www.codechef.com/KJCC2015/problems/WINNER

could anyone please say logic for solvig this problem.thank you.

thanks again..!!!

• -6

By vsanjay_nitdgp, history, 4 years ago, ,

Sir/mam,

Today i wanna ask a question that many coders on CF might be thinking of.

i am still a div-2 contestant.i solved not more than 2 problems for my last 7 contests.

on averge i solve 2 problems in any contest.

BUT HOW TO SOLVE 3 AND 4?

I saw many coders who solve 3 and 4 always in every contest.even i wanna solve like them.

so,today i ask this question to coders who solve more than 2 on an verage in every contest,

that what extra-thing you did,or what was the way that made yourself to solve 3 easily everytime,

and how should we appraoch to solve like you?

I HOPE MNY CODERS  LIKE ME MIGHT BE INTERESTED TO SEE COMMENTS THAT HELPS A LOT.

please share some links,books etc,that you think that may be useful to crack 3.

thanks in advance..........

• +4

By vsanjay_nitdgp, history, 4 years ago, ,

could any one explain the logic for his problem.

i couldn't understand the editorial.

http://codeforces.com/problemset/problem/466/C

• +5

By vsanjay_nitdgp, history, 4 years ago, ,

hello sir/mam,

i just started  learning graph theory from http://codeforces.com/blog/entry/3075  .

i learnt dfs and bfs traversal.

but ,i am still confused whether i am learning the things in right way one after other.

could you pls say the steps or path or map for learning graph theory...

i mean ,after traversal,which concpt should i learn.like that: :)

ls provide some links for tutorials ,problems,,,,,,so that if a beginner could work out hard and master this concept.

• +6

By vsanjay_nitdgp, history, 4 years ago, ,

hello sir/mam,

yesterday i started solving the following problem using stack..

https://www.hackerrank.com/challenges/largest-rectangle

this is my solution

http://ideone.com/SomZF4

i think my code is entirely correct,,,but dont know where it is going wrong.....answer has to be 9 for the sample input....but i am getting it as 5..

could any on pls say error in my code..

• 0

By vsanjay_nitdgp, history, 4 years ago, ,

sir/mam, i solved this problem

https://www.codechef.com/problems/DIRTBYTE

this is my solution,,, http://ideone.com/dt6lxi

but i dont know why am i getting TLE.

couls anyone pls help me to get AC..

thank you.

• 0

By vsanjay_nitdgp, history, 4 years ago, ,

i did DQUERY problem in spoj----link http://www.spoj.com/problems/DQUERY/

this is my solution...after referring through some material and blog AND finally got AC....

http://ideone.com/8qZj1Z

but ...could any one pls explain what happened between (53-72) lines....i couldnt understand....

pls explain it clearly so tht a beginner of this ALGO could understand.....also pls say if we can write those lines without any confusion if possible..

i would be very thankful to you....

thank you..

• -8

By vsanjay_nitdgp, history, 4 years ago, ,

sir/mam,,,

i tried the following problem using MO bu getting TLE........

my solution:http://ideone.com/MqzGnu

could anyone help me in getting AC

• -6

By vsanjay_nitdgp, history, 4 years ago, ,

could anyone pls give clear explaination of using BIT in this problem..

i would be very thankful to you.

http://www.spoj.com/problems/CTRICK/

• -3

By vsanjay_nitdgp, history, 4 years ago, ,

could anyone pls say how to get rid of TLE for this question.....

this is my solution https://www.codechef.com/viewsolution/7926715

i used BIT

• -3

By vsanjay_nitdgp, history, 4 years ago, ,

hello sir/mam.

recently i learnt binary indexed tree.

i did two probelms now...

but i got stuck for the problem below.....

http://www.spoj.com/problems/INVCNT/

could any one give clear explaination of doing this problem....

i would be very thankful to you...

• -3

By vsanjay_nitdgp, history, 4 years ago, ,

sir,,,i have just learnt how BIT works.....

i was trying to impliment the same for this problem :http://www.spoj.com/problems/HAYBALE/

but,i couldnt get idea how to do it,,,,,could anyone pls help me how to approach this problem using BIT..

• +4

By vsanjay_nitdgp, history, 4 years ago, ,

hello sir/mam.....

today i started binary indexed tree and couldnt fing good tutorial to master....

could any one pls provide ,,,,some links to tutorials and problems such tht a beginner could understand...

• 0

By vsanjay_nitdgp, history, 4 years ago, ,

this is my solution http://ideone.com/5i1hV2 for the problem

https://www.codechef.com/LTIME16/problems/CHEFB

in this problem i am getting TLE whn n<=100000 and array size<=1000000

but when i removed memset and wrote that step normally by bruteforce ....i got AC........

what happened with that memset();

why?????????????????

this is my modified solution

http://ideone.com/G6t0fX