Tags » Graphs

Dead Mom Syndrome

I was saying to someone the other day that I wish grief was similar to a broken arm, leg or some other illness. There is a process, almost a plan, when it comes to healing. 814 more words

Mom

Lessons Learned from a Review Lesson on Proportional Relationships In Graphs

Sometimes, I learn more from my lessons than my students do.   Of course, just as is true form my students, I have to be paying attention.   853 more words

Gold DoE Expedition

I recently undertook the expedition phase of my Gold Duke of Edinburgh in a Canadian open canoe. The team and I paddled from just outside Thetford all the way down to Cambridge on the River Thet, the Little Ouse, the Great Ouse and finally, the Cam. 356 more words

Software

Expert InDesign Freelancer

InDesigner available to hire for large or small artwork layout

An expert in InDesign means I know how to use to InDesign to its full potential and use it everyday. 54 more words

Freelance Artworker

UVa : 12376 - As Long as I Learn, I Live

/*
*  Code By : Pritish Thakkar
*  Tags : Graph Traversal + DFS
*/

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

ll temp;
vector<ll> g;
bool color;
ll ans=0,k=0;

void dfs(ll num){
	ll maxi=0,next=-1;
	color = true;	
	for(ll i=0;i<g.size();i++){
		ll cur_i = g[i]; 
		if(!color){
			if(temp > maxi){
				maxi = temp;
				next = cur_i;
			}
		}
	}
	if(next != -1) {k=next;ans+=maxi;dfs(next);}
	return;
}

int main(){
	ll t,counter=0;
	cin>>t;
	while(t--){
		ll n,m,x,a,b;
		cin>>n>>m;
		for(ll i=0;i<n;i++){
			cin>>temp[i];
		}
		for(ll i=0;i<m;i++){
			cin>>a>>b;
			g[a].push_back(b);
		}
		/*
		ADJACENCY LIST :
		for(ll i=0;i<n;i++){
			for(ll j=0;j<g[i].size();j++){
				cout<<g[i][j]<<" ";
			}
			cout<<endl;
		}
		*/
		memset(color,false,sizeof(color));
		ans=0;
		dfs(0);
		cout<<"Case "<<++counter<<": "<<ans<<" "<<k<<endl;
		for(ll i=0;i<n;i++) g[i].clear();
	}
			
} 9 more words
Data Structures

Breaking News! 85% Of You Do It! PANTS ON FIRE!

It has been reported from a trusted source, that most people make something up or just lie everyday.

USA Today had this graphic to prove their point. 9 more words

Graphs

Clarifying Charts in PowerPoint

Graphs (Microsoft calls them “charts”) are a visual way to present numerical data, often financial. But, because charts can present too much information in one shot, they can overload an audience. 896 more words

Tips