IS THERE ANY GOOD LINK OF NETWORK FLOW AND IT'S IMPLIMENTATION ?
| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | turmax | 3559 |
| 6 | tourist | 3541 |
| 7 | strapple | 3515 |
| 8 | ksun48 | 3461 |
| 9 | dXqwq | 3436 |
| 10 | Otomachi_Una | 3413 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 157 |
| 2 | adamant | 153 |
| 3 | Um_nik | 147 |
| 3 | Proof_by_QED | 147 |
| 5 | Dominater069 | 145 |
| 6 | errorgorn | 142 |
| 7 | cry | 139 |
| 8 | YuukiS | 135 |
| 9 | TheScrasse | 134 |
| 10 | chromate00 | 133 |
IS THERE ANY GOOD LINK OF NETWORK FLOW AND IT'S IMPLIMENTATION ?
PLZ ANY ONE PROVIDE A GUD LINK OF IMPLIMENTATION OF SNAKE AND LADDER GRAPHICAL GAME IN JAVA ?
http://www.spoj.pl/problems/ANARC05H how to approach this?
problem . why i m getting wrong answer ~~~~~ ` ~~~~~ Your code here... ~~~~~
#include<iostream>
#include<cmath>
#include<utility>
#include<cstdio>
using namespace std;
int N=50000;
int M[1<<23][2];
int a[1<<23];
void initialize(int node,int i,int j)
{
if(i==j)
{
if(a[i]>0)
M[node][0]=a[i];
else
M[node][0]=0;
M[node][1]=a[i];
}
else
{
initialize(2*node,i,(i+j)/2);
initialize(2*node+1,(i+j)/2+1,j);
M[node][0]=M[2*node][0]+M[2*node+1][0];
M[node][1]=M[2*node][1]>M[2*node+1][1]?M[2*node][1]:M[2*node+1][1];
}
}
pair<int,int> query(int node,int b,int e,int i,int j)
{
pair<int,int> p1,p2;
if(i>e||j<b)
return make_pair(0,-15008);
if(b>=i&&e<=j)
return make_pair(M[node][0],M[node][1]);
p1=query(2*node,b,(b+e)/2,i,j);
p2=query(2*node+1,(b+e)/2+1,e,i,j);
return make_pair(p1.first+p2.first,max(p1.second,p2.second));
}
int main()
{
pair<int,int> AL;
int m,n;
cin>>n;
for(int i=0;i<n;i++)
cin>>a[i];
initialize(1,0,n-1);
cin>>m;
int x,y;
while(m--)
{
cin>>x>>y;
AL=query(1,0,n-1,x-1,y-1);
if(AL.first==0)
cout<<AL.second<<endl;
else
cout<<AL.first<<endl;
}
}plz any one provide a good implementation of Binary indexed Tree in 1D and 2D and the related problems .
PLZ ANYONE PROVIDE A GOOD LINK FOR NUMBER THEORY AND IT'S PROBLEM'S OF EASY ,MEDIUM AND HARD LEVEL :)
IS THERE ANY ONE WHO CAN PROVIDE A GOOD LINK OF UNION OF AREA OF RECTANGLES IN ENGLISH :)
CAN ANYONE GIVE ME A GOOD LINK OF SUFFIX ARRAY IN ENGLISH :)
http://www.spoj.com/problems/PAIRSUM/ can any one tell me how to approach this problem
| Name |
|---|


