Skip to content

Instantly share code, notes, and snippets.

View tmp.cpp
//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>
View tmp.cpp
//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>
View tmp.cpp
//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>
View elevator.cpp
//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>
View list.js
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 Mar 26, 2019 — forked from Chillee/2D BIT.cpp
Segment tree
View 2D BIT.cpp
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) {