[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/joney000/Java-Competitive-Programming/threads/Algorithms/BIT.java [Back]  [Original]

import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;

/*
 * Author    : joney_000[let_me_start]
 * Algorithm : Bit / fenwick tree
 * Platform  : Codeforces
 * Ref       : https://sanugupta.wordpress.com/2014/08/29/binary-indexed-tree-fenwick-tree/
 */

public class A{ 
  
  private InputStream inputStream ;
  private OutputStream outputStream ;
  private FastReader in ;
  private PrintWriter out ;
  
  private final int BUFFER = 200005;
  
  private int    auxInts[] = new int[BUFFER];
  private long   auxLongs[] = new long[1];
  private double auxDoubles[] = new double[1];
  private char   auxChars[] = new char[1];
  private final long mod = 1000000000+7;
  private final int  INF  = Integer.MAX_VALUE;
  private final long INF_L  = Long.MAX_VALUE / 10;

  public A(){}
  public A(boolean stdIO)throws FileNotFoundException{
    // stdIO = false;
    if(stdIO){
      inputStream = System.in;
      outputStream = System.out;
    }else{
      inputStream = new FileInputStream("input.txt");
      outputStream = new FileOutputStream("output.txt");
    }
    in = new FastReader(inputStream);
    out = new PrintWriter(outputStream);
  }
  
  
  void run()throws Exception{
    int n = i(); int q = i(); int m = i();
    int qry[][] = new int[3][q + 1];// 0=>l, 1=> r, 2=>val
    int a[] = new int[n + 1];

    for(int i = 1; i 

Web Proxy Viewer  |  New URL  |  Original Page