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; | |
#define mx 50005 | |
typedef pair<long long int,int> PII; | |
vector<PII>g[mx]; | |
bool marked[mx]; | |
long long prim(int x) | |
{ | |
priority_queue<PII, vector<PII>, greater<PII> > Q; | |
int y; |
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; | |
#define mx 500005 | |
int id[mx],n,m; | |
pair <long long, pair<int, int> > p[mx]; | |
void initialize() | |
{ | |
for(int i = 0; i < mx; ++i) | |
id[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> | |
using namespace std; | |
#define mx 100005 | |
vector<int>g[mx]; | |
int visited[mx]; | |
bool articulation[mx]; | |
int low[mx],d[mx],parent[mx]; | |
int t; |
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 50005 | |
using namespace std; | |
vector<int>g[mx],rg[mx],path,newg[mx]; | |
int visited[mx],scc[mx]; | |
int numscc; | |
void dfs1(int s) |
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; | |
#define mx 200005 | |
vector<int>g[mx]; | |
vector<int>ans; //storing topological sorted vertex | |
int indegree[mx]; | |
/*int visited[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> | |
using namespace std; | |
#define mx 200005 | |
vector<int>g[mx]; | |
int visited[mx]; | |
stack<int>s; | |
void dfs(int u) | |
{ | |
visited[u]=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> | |
using namespace std; | |
#define MAX 2000005 | |
class Graph | |
{ | |
vector<int>g[MAX]; | |
int color[MAX]; | |
long long in[MAX]; | |
long long out[MAX]; | |
int edges; |
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; | |
#define pii pair<int,int> | |
#define pb push_back | |
#define INF 0x7fffffff | |
#define sz 100005 | |
priority_queue<pii,vector<pii>,greater<pii> >q; | |
vector<pii>G[sz]; | |
int dist[sz]; | |
bool vis[sz]; |
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; | |
#define mx 505 | |
long long matrix[mx][mx]; | |
int main() | |
{ | |
memset(matrix,INT_MAX,sizeof matrix); |
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 inf=INT_MAX; | |
vector< pair<int,int> >edge; | |
int w[205][205]; | |
int b[205]; | |
int dist[205]; | |
int n,m; |
OlderNewer