-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmainbc.cpp
More file actions
47 lines (46 loc) · 897 Bytes
/
mainbc.cpp
File metadata and controls
47 lines (46 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "_graph.h"
int main(int argc,char **argv)
{
freopen(argv[1], "r", stdin);
freopen(argv[2], "w", stdout);
vector<edge>l;
int n,m;
int p,q;
cin>>n;
cin>>m;
int m1=0;
for(int i=0;i<m;i++)
{
int x;
int y;
cin>>x;
cin>>y;
l.push_back(edge(x,y));
l.push_back(edge(y,x));
m1++;
}
sort(l.begin(),l.end(),comp_edges);
graph *g = new graph(n,2*m1,l);
g->do_basic();
g->find_btw();
int t;
cin>>t;
for(int j=0;j<t;j++)
{
vector<edge> added;
vector<edge> del;
int k;
cin>>k;
for(int i=0;i<k;i++)
{
edge e;
cin>>e.x;
cin>>e.y;
added.push_back(e);
added.push_back(edge(e.y,e.x));
m1+=1;
}
update_btw(&g,added,del);
}
return 0;
}