Skip to content

Commit 9ed2532

Browse files
committed
making template better for graph input
1 parent 3a60182 commit 9ed2532

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Library/Miscellanious/template.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ void ipgraph(int n, int m){
7777
int i, u, v;
7878
while(m--){
7979
cin>>u>>v;
80-
g[u-1].pb(v-1);
81-
g[v-1].pb(u-1);
80+
u--, v--;
81+
g[u].pb(v);
82+
g[v].pb(u);
8283
}
8384
}
8485

0 commit comments

Comments
 (0)