- http://codeforces.com/problemset/problem/148/A using Inclusion-Exclusion Principle
- After completing entire ladder, revisit them again and try a diff approach
My Library
Saturday, 5 January 2019
my TO-DO list :
Monday, 15 October 2018
Behold the fBUG
Search for a range, a probelm in inerviewbit binary search section..... everything seems fine..i wrote a afunction based on the tutorial of mycodeschool and getting TLE coz of infinte loop for some trest case...
but instead of making func call using bool.... i jz wrote exact copy of func..and got accepted....still dont understand why it happened .
https://www.interviewbit.com/courses/1/topics/4/problems/search-for-a-range/previous_submissions/
TLE : 11
AC : 12
but instead of making func call using bool.... i jz wrote exact copy of func..and got accepted....still dont understand why it happened .
https://www.interviewbit.com/courses/1/topics/4/problems/search-for-a-range/previous_submissions/
TLE : 11
AC : 12
Sunday, 19 August 2018
Trick to visit all 4 adj. blocks in a matrix
int di[]={1,-1,0,0}; // <-----THIS IS THE TRICK---|
int dj[]={0,0,1,-1}; // <------------------------------|
for(int i=0;i<4;i++){ // ALL FOUR ADJ. BLOCKSI=a+di[i];J=b+dj[i];if(I>=0 && I<r && J>=0 && J<c) //validation for borders//CODE;}
Sunday, 15 July 2018
AGC 026
A - Colorful Slimes 2
Remember the boundary cases.Missed coz of "off by one error"
yutaka1999 (contest Rank : 1) sol's idea was diff. than mine but its useful ;)
Remember the boundary cases.Missed coz of "off by one error"
yutaka1999 (contest Rank : 1) sol's idea was diff. than mine but its useful ;)
Thursday, 12 July 2018
SPOJ - ELEVTRBL
SPOJ - ELEVTRBL
At first, my untrained mind doesnt got the BEAUTY of bfs....
MIND-BLOWN by the simple fact !!!
Solution referred : http://shuklas664.blogspot.com/2015/07/spoj-elevtrbl-solution.html
Cool !!!
Friday, 9 March 2018
13A-Numbers.... Simple, yet logical
Ref : http://codeforces.com/problemset/problem/13/A
Here, the nr and dr can be found easily, but they can be factored out by some number....
That's the tricky thing !!!
Happy Coding and stay *HUMBLE*
Here, the nr and dr can be found easily, but they can be factored out by some number....
That's the tricky thing !!!
Happy Coding and stay *HUMBLE*
Subscribe to:
Posts (Atom)
