Skip to content

Instantly share code, notes, and snippets.

//dhruv
#include<bits/stdc++.h>
using namespace std;
// #define int long long
#define ll long long
#define ffor(i,n) for(int i = 0;i < (n); ++i)
#define fro(i,j,n) for(int i = (j);i < (n); ++i)
#define all(v) v.begin(),v.end()
#define vi vector<int>
//dhruv
#include<bits/stdc++.h>
using namespace std;
// #define int long long
#define ll long long
#define ffor(i,n) for(int i = 0;i < (n); ++i)
#define fro(i,j,n) for(int i = (j);i < (n); ++i)
#define all(v) v.begin(),v.end()
#define vi vector<ll>
//dhruv
#include<bits/stdc++.h>
using namespace std;
// #define int long long
#define ll long long
#define ffor(i,n) for(int i = 0;i < (n); ++i)
#define fro(i,j,n) for(int i = (j);i < (n); ++i)
#define all(v) v.begin(),v.end()
#define vi vector<int>
//dhruv
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ffor(i,n) for(int i = 0;i < (n); ++i)
#define fro(i,j,n) for(int i = (j);i < (n); ++i)
#define all(v) v.begin(),v.end()
#define vi vector<int>
import React from 'react';
class TodoList extends React.Component {
constructor(props) {
super(props);
this.addTodo = this.addTodo.bind(this);
this.handleNewTaskInput = this.handleNewTaskInput.bind(this);
this.handleNewTaskSubmit = this.handleNewTaskSubmit.bind(this);
this.state = {
@medhruv7
medhruv7 / 2D BIT.cpp
Created March 26, 2019 21:49 — forked from Chillee/2D BIT.cpp
Segment tree
int N, M;
int bit[MAXN][MAXN];
int sum(int x, int y) {
int ret = 0;
for (int i = x; i >= 0; i = (i & (i + 1)) - 1)
for (int j = y; j >= 0; j = (j & (j + 1)) - 1)
ret += bit[i][j];
return ret;
}
void add(int x, int y, int delta) {