Submission #62511998
Source Code Expand
use std::collections::BTreeSet; #[allow(unused_imports)] use itertools::Itertools; use proconio::input; fn main() { input!{ n: usize, m: usize, a: [usize; m], } let set = BTreeSet::from_iter(a.iter().copied()); let ans = (1..=n).filter(|i| !set.contains(i)).collect_vec(); println!("{}", ans.len()); println!("{}", ans.iter().join(" ")); } pub trait Debuggable { fn debug_string(&self) -> String; } impl<T: std::fmt::Debug + std::fmt::Display> Debuggable for Vec<T> { fn debug_string(&self) -> String { use itertools::Itertools; use std::iter::repeat; if let Some(max_size) = self.iter() .enumerate() .map(|(i, x)| (format!("{:?}", x).len()).max(format!("{:?}", i).len())) .max() { let mut idx = String::from("idx |"); let mut val = String::from("val |"); for (i, xi) in self.iter().enumerate() { idx.push_str( &format!(" {:>w$} |", i, w=max_size) ); val.push_str( &format!(" {:>w$} |", xi, w=max_size) ); } format!("{}\n{}\n{}\n", idx, repeat('-').take(idx.len()).join(""), val) } else { format!("idx | \nval |\n") } } } impl<T: std::fmt::Debug + std::fmt::Display> Debuggable for std::collections::BTreeSet<T> { fn debug_string(&self) -> String { use itertools::Itertools; format!("{{ {} }}", self.iter().join(", ")) } } impl<T, U> Debuggable for std::collections::BTreeMap<T, U> where T: std::fmt::Debug + std::fmt::Display, U: std::fmt::Debug + std::fmt::Display { fn debug_string(&self) -> String { use itertools::Itertools; format!( "{{\n{}\n }}", self.iter() .map(|(k, v)| format!("{k} -> {v}, ")) .join("\n") ) } } // lg! マクロの定義 #[macro_export] macro_rules! lg { ($val:expr) => { #[cfg(feature = "local")] { { use Debuggable; let val = &$val; eprintln!( "[{}:{}] {} = \n{}", file!(), line!(), stringify!($val), val.debug_string() ); val } } } }
Submission Info
Submission Time | |
---|---|
Task | B - Who is Missing? |
User | ardRiriy |
Language | Rust (rustc 1.70.0) |
Score | 200 |
Code Size | 2488 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 2116 KiB |
Compile Error
warning: the item `Itertools` is imported redundantly --> src/main.rs:25:13 | 3 | use itertools::Itertools; | -------------------- the item `Itertools` is already imported here ... 25 | use itertools::Itertools; | ^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default warning: the item `Itertools` is imported redundantly --> src/main.rs:51:13 | 3 | use itertools::Itertools; | -------------------- the item `Itertools` is already imported here ... 51 | use itertools::Itertools; | ^^^^^^^^^^^^^^^^^^^^ warning: the item `Itertools` is imported redundantly --> src/main.rs:60:13 | 3 | use itertools::Itertools; | -------------------- the item `Itertools` is already imported here ... 60 | use itertools::Itertools; | ^^^^^^^^^^^^^^^^^^^^
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | sample_01.txt, sample_02.txt, sample_03.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt, test_25.txt, test_26.txt, test_27.txt, test_28.txt, test_29.txt, test_30.txt, test_31.txt, test_32.txt, test_33.txt, test_34.txt, test_35.txt, test_36.txt, test_37.txt, test_38.txt, test_39.txt, test_40.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 1 ms | 1940 KiB |
sample_02.txt | AC | 1 ms | 1848 KiB |
sample_03.txt | AC | 0 ms | 2084 KiB |
test_01.txt | AC | 1 ms | 1940 KiB |
test_02.txt | AC | 0 ms | 1908 KiB |
test_03.txt | AC | 0 ms | 2060 KiB |
test_04.txt | AC | 1 ms | 1924 KiB |
test_05.txt | AC | 0 ms | 2072 KiB |
test_06.txt | AC | 0 ms | 1972 KiB |
test_07.txt | AC | 1 ms | 2104 KiB |
test_08.txt | AC | 1 ms | 1960 KiB |
test_09.txt | AC | 1 ms | 2116 KiB |
test_10.txt | AC | 1 ms | 2100 KiB |
test_11.txt | AC | 1 ms | 1912 KiB |
test_12.txt | AC | 0 ms | 1940 KiB |
test_13.txt | AC | 0 ms | 2020 KiB |
test_14.txt | AC | 1 ms | 1964 KiB |
test_15.txt | AC | 0 ms | 2088 KiB |
test_16.txt | AC | 1 ms | 1768 KiB |
test_17.txt | AC | 1 ms | 2024 KiB |
test_18.txt | AC | 1 ms | 1952 KiB |
test_19.txt | AC | 0 ms | 1940 KiB |
test_20.txt | AC | 1 ms | 1992 KiB |
test_21.txt | AC | 1 ms | 2096 KiB |
test_22.txt | AC | 1 ms | 1768 KiB |
test_23.txt | AC | 1 ms | 1908 KiB |
test_24.txt | AC | 1 ms | 2024 KiB |
test_25.txt | AC | 1 ms | 2100 KiB |
test_26.txt | AC | 1 ms | 1968 KiB |
test_27.txt | AC | 1 ms | 1868 KiB |
test_28.txt | AC | 0 ms | 1940 KiB |
test_29.txt | AC | 0 ms | 1964 KiB |
test_30.txt | AC | 1 ms | 2016 KiB |
test_31.txt | AC | 0 ms | 1924 KiB |
test_32.txt | AC | 1 ms | 1964 KiB |
test_33.txt | AC | 0 ms | 1860 KiB |
test_34.txt | AC | 1 ms | 1984 KiB |
test_35.txt | AC | 1 ms | 1936 KiB |
test_36.txt | AC | 1 ms | 1904 KiB |
test_37.txt | AC | 1 ms | 1944 KiB |
test_38.txt | AC | 1 ms | 1948 KiB |
test_39.txt | AC | 1 ms | 2096 KiB |
test_40.txt | AC | 0 ms | 1880 KiB |