Hi Everyone,
Below is my code for this problem. It uses simple Breadth first search. Moreover, for each node, it tries to color it both white and black(assuming adjacent node is not black). I have no idea why my output in not right. I will be grateful if someone could take a look and tell what is ...
Search found 3 matches
- Sat Feb 23, 2013 3:49 pm
- Forum: Volume 1 (100-199)
- Topic: 193 - Graph Coloring
- Replies: 93
- Views: 36626
- Mon Feb 11, 2013 4:04 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10130 - SuperSale
- Replies: 76
- Views: 35589
Re: 10130 - SuperSales
Below is my code. No idea why get wa. pls help :
#include<cstring>
#include<cstdio>
#include<iostream>
using namespace std;
int n, g, sum = 0;
int p[105],w[105];
int dp[1004][35];// num of object and weight left
int knapsack(int resourcel, int item){
//if(resourcel < 0) return (1<<31);
if(item ...
#include<cstring>
#include<cstdio>
#include<iostream>
using namespace std;
int n, g, sum = 0;
int p[105],w[105];
int dp[1004][35];// num of object and weight left
int knapsack(int resourcel, int item){
//if(resourcel < 0) return (1<<31);
if(item ...
- Mon Jan 21, 2013 12:01 pm
- Forum: Volume 7 (700-799)
- Topic: 727 - Equation
- Replies: 156
- Views: 56950
Re: 727 Equation TLE
Removed