Given a set of values..in which there are some dependencies..
Eg.. x y z a b
Dependencies: x,y
a,z
Note that dependency is not transitive..Is it possible to separate
these elements into sets such that no two elements in the same set are
dependant and we should end up with the least number of se
i am new to segment trees..i tried this problem in spoj..
http://www.spoj.pl/problems/BRCKTS
am getting WA..
pls help...
code:
#include
#include
#include
#include
#include
using namespace std;
class pi
{
public:
int a,b;
pi(){a=0;b=0;}
p
i tried solving this prob...
http://www.spoj.pl/problems/POUR1/
i tried using BFS...getting TLE in judge..
pl suggest some optimisation or better solution..
Thanks in advance..
Code:
http://ideone.com/qIgcU
--
You received this message because you are subscribed to the Google Groups
i am a beginner.pl help me with this code.i submitted a solution.it s
giving op for all given testcases.but the judge is giving me a TLE.
code:
#include
#include
#define inf 9
using namespace std;
map m2;
int func(map &m1,int w)
{
if(m2[w]::iterator it;
int min=inf;
for(it=m1.begin();i