Skip to main content

read_all_unchecked

Function read_all_unchecked 

Source
pub fn read_all_unchecked(reader: impl Read) -> String
Examples found in repository?
crates/aizu_online_judge/src/grl/grl_4_b.rs (line 12)
11pub fn judge_grl_4_b(input: impl Read, _output: impl Read, result: impl Read) -> bool {
12    let (s_in, s_res) = (read_all_unchecked(input), read_all_unchecked(result));
13    let (mut scanner_in, mut scanner_res) = (Scanner::new(&s_in), Scanner::new(&s_res));
14    scan!(scanner_in, vs, es, edges: [(usize, usize); iter es]);
15    let mut ord = vec![!0usize; vs];
16    let mut is_ac = true;
17    for (i, u) in scanner_res.iter::<usize>().take(vs).enumerate() {
18        is_ac &= ord[u] == !0usize;
19        ord[u] = i;
20    }
21    for (u, v) in edges {
22        is_ac &= ord[u] < ord[v];
23    }
24    is_ac
25}