Skip to content

Instantly share code, notes, and snippets.

View bhi5hmaraj's full-sized avatar
🏖️

Bhishmaraj bhi5hmaraj

🏖️
View GitHub Profile
/***
*
* This is my personal collections of redundant code snippets used in various programming problems
*
* @author Bhishmaraj S (matib275@gmail.com)
* */
import java.util.*;
import java.util.stream.IntStream;
import java.io.*;

Some interesting concepts from psychology, which I've found useful

  1. Cognitive Biases - If there is one concept that someone should know about psychology then it would be cognitive biases. These are systemic mistakes/heuristics that the brain is susceptible to which leads us to make irrational decisions. This website has some really good explanations

  2. BF Skinner's behavior design techniques used in designing addictive apps/games - B.F Skinner was a major proponent of the behavioral school of psychologists. He is famous for his theory of operant conditioning - Check out this famous Skinner pigeon experiment. His theories are now being used to make apps more addictive , more info can be found here and [here](https://www.

<div class=\"ttypography\">
<p>Today I want to introduce you some very very useful data structures.</p>
<p>In this lecture, we are trying to improve your data structures skills, stay with us and click on <strong>read more</strong>. Important data structures :</p>
<h2>Trees</h2>
<p>Trees are one of the most useful data structures.A tree is a connected-acyclic graph.There are too many types of trees, like : rooted trees, weighted trees, directed trees, tries, etc.</p>
<h2>Partial sum</h2>
<p>There are two types of problems solvable by partial sum.</p>
<p>1.Problems which you are asked to answer some queries about the sum of a part of elements (without modify queries).</p>
<p>Solution of all of this problems are the same. You just need to know how to solve one of them.</p>
<p>Example : You are asked some queries on an array <span class=\"tex-span\"><i>a</i><sub class=\"lower-index\">1</sub>, <i>a</i><sub class=\"lower-index\">2</sub>, ...<i>a</i>, <sub class=\"lower-index\"><i>n</i></s
import java.util.*;
import java.io.*;
class {
public static void main(String args[]) {
FastScanner scan = new FasrScanner();
PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out), true); //Close the output stream after use
int t = scan.nextInt();
while(t-->0) {
out.println(t);
import java.util.*;
import java.io.*;
public class timus_1523 {
/************************ SOLUTION STARTS HERE ************************/
static final int MOD = (int) 1e9;
@bhi5hmaraj
bhi5hmaraj / GuardiansoftheLunaticsVol2.java
Created January 2, 2018 04:00
Naive O(N^2) DP solution
import java.util.*;
import java.io.*;
public class GuardiansoftheLunaticsVol2 {
/************************ SOLUTION STARTS HERE ************************/
static long memo[];
static long pref[];
import java.util.*;
import java.io.*;
class ETFS {
/************************ SOLUTION STARTS HERE ************************/
static int primes[];
static final int MAX = (int) 1e7;
import java.util.*;
import java.io.*;
public class LA_5117 {
/************************ SOLUTION STARTS HERE ************************/
static class MM { // MM (Modular Math) class
@bhi5hmaraj
bhi5hmaraj / LA_5116.java
Last active November 11, 2017 05:01
AC code
import java.util.*;
import java.io.*;
public class LA_5116 {
/************************ SOLUTION STARTS HERE ************************/
static int P;
static int primes[] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67};
import java.util.*;
import java.io.*;
public class FacelessArya {
/************************ SOLUTION STARTS HERE ************************/
static int MAX = (int) 1e6;