Struct SparseGraphScanner
Source pub struct SparseGraphScanner<U, T, D>{ }
crates/competitive/src/graph/sparse_graph.rs (
line 273)
272 fn mscan<'a, I: Iterator<Item = &'a str>>(self, iter: &mut I) -> Option<Self::Output> {
273 UndirectedGraphScanner::<U, T>::new(self.vsize, self.vsize - 1).mscan(iter)
274 }
More examples
Hide additional examples
crates/aizu_online_judge/src/grl/grl_4_a.rs (
line 9)
6pub fn grl_4_a(reader: impl Read, mut writer: impl Write) {
7 let s = read_all_unchecked(reader);
8 let mut scanner = Scanner::new(&s);
9 scan!(scanner, vs, es, (graph, _): @DirectedGraphScanner::<usize, ()>::new(vs, es));
10 writeln!(writer, "{}", (graph.topological_sort().len() != vs) as u32).ok();
11}
crates/aizu_online_judge/src/grl/grl_4_b.rs (
line 9)
6pub fn grl_4_b(reader: impl Read, mut writer: impl Write) {
7 let s = read_all_unchecked(reader);
8 let mut scanner = Scanner::new(&s);
9 scan!(scanner, vs, es, (graph, _): @DirectedGraphScanner::<usize, ()>::new(vs, es));
10 for u in graph.topological_sort().into_iter() {
11 writeln!(writer, "{}", u).ok();
12 }
13}
crates/aizu_online_judge/src/grl/grl_3_b.rs (
line 9)
6pub fn grl_3_b(reader: impl Read, mut writer: impl Write) {
7 let s = read_all_unchecked(reader);
8 let mut scanner = Scanner::new(&s);
9 scan!(scanner, vs, es, (graph, _): @UndirectedGraphScanner::<usize, ()>::new(vs, es));
10 let mut bridge = LowLink::new(&graph).bridge;
11 bridge.sort_unstable();
12 for (u, v) in bridge.into_iter() {
13 writeln!(writer, "{} {}", u, v).ok();
14 }
15}
crates/aizu_online_judge/src/grl/grl_3_a.rs (
line 9)
6pub fn grl_3_a(reader: impl Read, mut writer: impl Write) {
7 let s = read_all_unchecked(reader);
8 let mut scanner = Scanner::new(&s);
9 scan!(scanner, vs, es, (graph, _): @UndirectedGraphScanner::<usize, ()>::new(vs, es));
10 let mut articulation = LowLink::new(&graph).articulation;
11 articulation.sort_unstable();
12 for u in articulation.into_iter() {
13 writeln!(writer, "{}", u).ok();
14 }
15}
crates/aizu_online_judge/src/grl/grl_3_c.rs (
line 9)
6pub fn grl_3_c(reader: impl Read, mut writer: impl Write) {
7 let s = read_all_unchecked(reader);
8 let mut scanner = Scanner::new(&s);
9 scan!(scanner, vs, es, (graph, _): @DirectedGraphScanner::<usize, ()>::new(vs, es));
10 let scc = StronglyConnectedComponent::new(&graph);
11 scan!(scanner, q);
12 for (u, v) in scanner.iter::<(usize, usize)>().take(q) {
13 writeln!(writer, "{}", (scc[u] == scc[v]) as u32).ok();
14 }
15}
Additional examples can be found in:
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.