diff --git a/README.md b/README.md index 065e37a..d9355a4 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,7 @@ - https://github.com/EbTech/rust-algorithms - https://github.com/qitoy/rust-library - https://github.com/stuart0035/procon-lib-rs + +## Our List of Recommended Practice Problems + +[gitgud.cc](https://www.gitgud.cc/) diff --git a/examples/data_structures/deq_agg.rs b/examples/data_structures/deq_agg.rs index d1f880b..3f2d3b6 100644 --- a/examples/data_structures/deq_agg.rs +++ b/examples/data_structures/deq_agg.rs @@ -2,7 +2,7 @@ use proconio::input; use programming_team_code_rust::data_structures::deq_agg::DeqAgg; -use rand::{thread_rng, Rng}; +use rand::{Rng, thread_rng}; use std::collections::VecDeque; const MOD: u64 = 998_244_353; diff --git a/examples/data_structures/range_container_handmade.rs b/examples/data_structures/range_container_handmade.rs index e26762a..2603b24 100644 --- a/examples/data_structures/range_container_handmade.rs +++ b/examples/data_structures/range_container_handmade.rs @@ -1,7 +1,7 @@ // verification-helper: PROBLEM https://onlinejudge.u-aizu.ac.jp/courses/lesson/2/ITP1/all/ITP1_1_A use programming_team_code_rust::data_structures::range_container::RangeContainer; -use rand::{thread_rng, Rng}; +use rand::{Rng, thread_rng}; use std::collections::BTreeMap; fn main() { diff --git a/examples/graphs/bridges_aizu.rs b/examples/graphs/bridges_aizu.rs index faf58f1..ac16f17 100644 --- a/examples/graphs/bridges_aizu.rs +++ b/examples/graphs/bridges_aizu.rs @@ -24,7 +24,7 @@ fn main() { let mut all_bridges: Vec<(usize, usize)> = vec![]; - for (i, (mut u, mut v)) in edges.iter_mut().enumerate() { + for (i, &mut (mut u, mut v)) in edges.iter_mut().enumerate() { if is_bridge[i] { if u > v { std::mem::swap(&mut u, &mut v); diff --git a/examples/graphs/cuts_aizu.rs b/examples/graphs/cuts_aizu.rs index 9f4703b..717ddc4 100644 --- a/examples/graphs/cuts_aizu.rs +++ b/examples/graphs/cuts_aizu.rs @@ -30,7 +30,7 @@ fn main() { let all_cut_nodes = is_cut .iter() .enumerate() - .filter(|(_, &value)| value) + .filter(|&(_, &value)| value) .map(|(index, _)| index) .collect::>(); diff --git a/examples/helpers/lis_handmade.rs b/examples/helpers/lis_handmade.rs index 8815bd8..67d81b8 100644 --- a/examples/helpers/lis_handmade.rs +++ b/examples/helpers/lis_handmade.rs @@ -1,7 +1,7 @@ // verification-helper: PROBLEM https://onlinejudge.u-aizu.ac.jp/courses/lesson/2/ITP1/all/ITP1_1_A use programming_team_code_rust::helpers::lis::Lis; -use rand::{thread_rng, Rng}; +use rand::{Rng, thread_rng}; fn lis_quadratic(a: &[i32]) -> usize { let n = a.len(); diff --git a/src/data_structures/deq_agg.rs b/src/data_structures/deq_agg.rs index 6ebd133..44fb5ac 100644 --- a/src/data_structures/deq_agg.rs +++ b/src/data_structures/deq_agg.rs @@ -145,7 +145,7 @@ impl T> DeqAgg { if self.le.is_empty() { let mut ary = vec![]; std::mem::swap(&mut ary, &mut self.ri); - self.rebuild((ary.len() + 1) / 2, ary); + self.rebuild(ary.len().div_ceil(2), ary); } self.le.pop().map(|elem| elem.0) } diff --git a/src/graphs/count_paths_per_length.rs b/src/graphs/count_paths_per_length.rs index 8293b18..f8a7cdc 100644 --- a/src/graphs/count_paths_per_length.rs +++ b/src/graphs/count_paths_per_length.rs @@ -1,5 +1,5 @@ //! # Count the number of paths of each length in a tree -use crate::graphs::cent_decomp::{cent_decomp, CentDecompDfs}; +use crate::graphs::cent_decomp::{CentDecompDfs, cent_decomp}; use crate::numbers::fft::fft_multiply; fn conv(a: &[u64], b: &[u64]) -> Vec {