Instantly share code, notes, and snippets.

View blog.html
<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
View Template.java
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();
View timus_1523.java
import java.util.*;
import java.io.*;
public class timus_1523 {
/************************ SOLUTION STARTS HERE ************************/
static final int MOD = (int) 1e9;
View GuardiansoftheLunaticsVol2.java
import java.util.*;
import java.io.*;
public class GuardiansoftheLunaticsVol2 {
/************************ SOLUTION STARTS HERE ************************/
static long memo[];
static long pref[];
View ETFS.java
import java.util.*;
import java.io.*;
class ETFS {
/************************ SOLUTION STARTS HERE ************************/
static int primes[];
static final int MAX = (int) 1e7;
View LA_5117.java
import java.util.*;
import java.io.*;
public class LA_5117 {
/************************ SOLUTION STARTS HERE ************************/
static class MM { // MM (Modular Math) class
View LA_5116.java
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};
View FacelessArya.java
import java.util.*;
import java.io.*;
public class FacelessArya {
/************************ SOLUTION STARTS HERE ************************/
static int MAX = (int) 1e6;
View LA_5108.java
import java.util.*;
import java.io.*;
public class LA_5108 {
/************************ SOLUTION STARTS HERE ************************/
static double pt[][];
View uva_12546.java
import java.util.*;
import java.io.*;
public class uva_12546 {
/************************ SOLUTION STARTS HERE ************************/
static final int mod = 1000000007;
static final int modInv2 = 500000004; // 2^-1