Nikhil Raghav's Blog
/
Recent content on Nikhil Raghav's Blog
Hugo  gohugo.io
enus
© Nikhil Raghav 2020
Tue, 20 Oct 2020 00:00:00 +0000

Codeforces Round #676 (Div. 2)
/posts/cf1421/
Tue, 20 Oct 2020 00:00:00 +0000
/posts/cf1421/
Had to perform better than last round to increase the rating again but started thinking in wrong direction for problem D, but solved it afterwards without editorials and easy to come up with solution. So I had to get this analysis out of the way before tonight’s Div.3 round. Contest was easy enough till D. I’m still not able to understand how I will approach problem E, it will be a blog in itself when I understand that.

Codeforces Raif Round 1 [Div.1 + Div.2]
/posts/cf1428/
Sun, 18 Oct 2020 00:00:00 +0000
/posts/cf1428/
Most recent round I participated in after a break of about 2 weeks. This is a new exercise that I’ve started to note down my thoughts and performance history in these blogs. So that I don’t repeat same mistakes more often and have some more clarity about what I go through when I’m participating and it will also double up as notes for some techniques and styles I come across while solving or upsolving that contest.

Dilworth theorem and calculating length of all kind of Sequences
/posts/sequences/
Tue, 13 Oct 2020 00:00:00 +0000
/posts/sequences/

Some ideas in Dynamic Programming I want to remember
/wikipages/dp/
Tue, 13 Oct 2020 00:00:00 +0000
/wikipages/dp/
1. Counting Inversions with trie Problem 2. Sum of all LSBs in a range Problem 3. Palindromes in a range (Inclusion/Exclusion) Problem

Big Browser is watching
/posts/palemoon/
Sat, 10 Oct 2020 00:00:00 +0000
/posts/palemoon/
I love minimal software and always try to minimize bloat on whatever system I use. I also like to read too many blogs on internet but you don’t need a power hungry and feature rich browser to “just read blogs”. So recently, I came across this video introducing BadWolf, which is a minimal WebKitGTK+ based browser that has two very accessible buttons to toggle javascript and images on a webpage and one simple download manager.

Private search engine in 5 minutes
/posts/searx/
Mon, 21 Sep 2020 00:00:00 +0000
/posts/searx/
Every non privacy respecting search engine out there logs your search history to profile you and target you with more personalised ads, sometimes that also leads to a self created filter bubble.
Searx is a metasearch engine available under GPL 3, which compiles search results from more than 70 search engines. Fun fact is you can deploy it locally and enjoy searching from your customised search engine. I’ll walk you through the deployment.

Basic ffmpeg reference
/posts/ffmpegreference/
Sat, 19 Sep 2020 00:00:00 +0000
/posts/ffmpegreference/
1. Converting to some format ffmpeg i input.mp3 output.m4a 2. Merging audio and video Can change final container (mkv is most versatile), ffmpeg automatically decides the decoders for the job. ffmpeg i audio.mp3 i video.mp4 c copy merged_video.mkv 3. Keeping Output quality same as Input quality (sameq) ffmpeg i input.avi sameq output.mkv 4. Convert only first 30 seconds (t) ffmpeg i aadat.mp3 t 30 aadatintro.mp3 t also supports hh:mm:ss as time format Variation of this can be used to cut a part of the video, ss flag sets the start time.

Counting with hashmaps
/posts/countingwithmaps/
Tue, 15 Sep 2020 00:00:00 +0000
/posts/countingwithmaps/
It is a recurring and really useful idea to count some property in O(n) in an array if the relation is some kind of equation where right hand side and left hand side only differs in their indexes. For example counting number of subarrays with sum X.
1. Subarrays with sum X Let’s say we are given an array A of length N and we have to count how many subarrays of A sum up to a given number X.

About Me
/about/
Mon, 01 Jan 0001 00:00:00 +0000
/about/
RSS Feed
~$ ./nikhil.sh Output:  Position: Student at JC Bose University of Science & Tech Languages: C++, bash, Javascript Interests: Web development, Competitive Programming, Infosec, Music Github: https://www.github.com/nikhil1raghav Everywhere else as: nikhil1_raghav

Algebra
/wikipages/algebra/
Mon, 01 Jan 0001 00:00:00 +0000
/wikipages/algebra/
Algebra is linear and abstract Group : A set with an operation on which inverse, associativity and identity are defined

Combinatorics
/wikipages/combinatorics/
Mon, 01 Jan 0001 00:00:00 +0000
/wikipages/combinatorics/
1. Correspondence Mapping one problem to a simpler and equal problem. Counting numbers between 14 and 103 is equal to counting numbers between 1 and 89.
Problem #1 Count number of permutations $P$ of length $10$ such that $P=p_1,p_2,p_3,\cdots,p_{10}$ and $p_1>p_2>p_3>p_4>p_5$ and $p_5< p_6 < p_7 < p_8 < p_9 < p_10 $
Idea : $p_5$ is 1 obviously, now selecting any 4 numbers out of 9 will do as order is fixed.

Graphs : Some observations and notes
/wikipages/graphs/
Mon, 01 Jan 0001 00:00:00 +0000
/wikipages/graphs/
Use bfs when possible
Look out for 01 before djikstra
Independent set is a set of vertices, no two of which are adjacent.
Topsort
kahn’s algo (when need to preserve order sometimes like UVA 11060, enqueue 0 indegree nodes in a heap process them) simple dfs everywhere else DFS spanning tree
Back edge : explored to explored Tree edge : explored to unexplored Finding bridges and articulation points If some node is an articulation point then none of its descendants have a backedge to any of its ancestors .

Minimal office suite
/wikipages/office/
Mon, 01 Jan 0001 00:00:00 +0000
/wikipages/office/
1. Text editor Bookmark this or try pasting this for an instant text editor. data:text/html,<html contenteditable> Set a font and do some styling data:text/html, <body contenteditable style="lineheight:1.5;fontsize:30px;fontfamily:Roboto"> 2. Draw data:text/html,<canvas id="v"><script>d=document,d.body.style.margin=0,f=0,c=v.getContext("2d"),v.width=innerWidth,v.height=innerHeight,c.lineWidth=2,x=e=>e.clientXe.touches[0].clientX,y=e=>e.clientYe.touches[0].clientY,d.onmousedown=d.ontouchstart=e=>{f=1,e.preventDefault(),c.moveTo(x(e),y(e)),c.beginPath()},d.onmousemove=d.ontouchmove=e=>{f&&(c.lineTo(x(e),y(e)),c.stroke())},d.onmouseup=d.ontouchend=e=>f=0</script> 3. Presentations data:text/html,<style>@page{size: 6in 8in landscape;}</style><body><script>d=document;for(i=0;i<50;i++)d.body.innerHTML+='<div style="position:relative;width:90%;paddingtop:60%;margin:5%;border:1px solid silver;pagebreakafter:always;"><div contenteditable style="outline:none;position:absolute;right:10%;bottom:10%;left:10%;top:10%;fontsize:5vmin;"></div></div>';d.querySelectorAll("div>div").forEach(e=>e.onkeydown=e=>{n=e.ctrlKey&&e.altKey&&e.keyCode49,x=["formatBlock","formatBlock","justifyLeft","justifyCenter","justifyRight","outdent","indent","insertUnorderedList"][n],y=["<h1>","<div>"][n],x&&document.execCommand(x,!1,y)})</script>

Recurrence relations
/wikipages/recurrence/
Mon, 01 Jan 0001 00:00:00 +0000
/wikipages/recurrence/
Convert recurrence relation to closed form Use method of differences if $k^{th}$ order of differences are in A.P. then it is a polynomial of degree $k+1$. if $k^{th}$ order of differences are in G.P. with common ration $r$ and first term $a$, then $n^{th}$ term is $ar^n + bn^{k1} + \cdots + c$.

Table of Contents
/contents/
Mon, 01 Jan 0001 00:00:00 +0000
/contents/
Competitive Programming: Techniques Counting with maps Linux: Media Basic ffmpeg reference Privacy: Local Searx instance Big Browser is watching

Wiki
/wiki/
Mon, 01 Jan 0001 00:00:00 +0000
/wiki/
This is my wiki where I try to organize my knowledge and make some notes for reference. It currently doesn’t contain much content but I’ll try to add more over time. To note down something that is too concise to be a post on its own.
Programming Graphs Algebra Recurrence Combinatorics Dynamic Programming