This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
#define mx 1429432 | |
#define ll long long int | |
#define test_case printf("Case %d:",id++) | |
using namespace std; | |
int arr[mx+5],node[4*mx+5],n; | |
void build(int ind,int b,int e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define mx 200005 | |
using namespace std; | |
int arr[mx+1],node[4*mx+1],x; | |
void build(int ind,int i,int j) | |
{ | |
if(i==j) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int arr[100005],node[400005]; | |
void init(int i,int j,int n) | |
{ | |
if(i==j) | |
{ | |
node[n]=arr[i]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
#define ll unsigned long long int | |
#define mx 10005 | |
using namespace std; | |
vector <int> G[mx]; | |
int level[mx],parent[mx]; | |
int sparse_table[30][mx]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
#define ll unsigned long long int | |
using namespace std; | |
int arr[100005],node[100005],n; | |
void update(int ind,int val) | |
{ | |
for(int i=ind;i<=n;i+=(i&-i)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
#define ll unsigned long long int | |
using namespace std; | |
ll arr[1000],x[70000],y[70000],l,j,maxmul,mul_limit,cnt; | |
void cal1(ll i,ll n,ll mul,ll result[]) | |
{ | |
if(i==n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int cnt; | |
void solve(int n,char from,char to,char aux) | |
{ | |
cnt++; | |
if(n==1) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define ll long long int | |
using namespace std; | |
ll arr[2000],x[20000],n,m,k,wt,p,y; | |
void cal(int i,int s) | |
{ | |
if(s>wt) | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define ll long long int | |
using namespace std; | |
ll arr[2000],x[50000],n,m,k,wt,p,y; | |
void cal(int i,ll s) | |
{ | |
if(i==m) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define ll long long int | |
using namespace std; | |
int a[4000],b[4000],c[4000],d[4000]; | |
int x[7000000],y[7000000]; | |
int main() | |
{ |