aboutsummaryrefslogtreecommitdiff
path: root/2022/07/b.rs
blob: 92bedc739d24ca168402c94ff63c0433457e94ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
mod common;
use common::*;

fn main() {
    let fs = FileSystem::build_from_stdin();
    let remaining = 70000000 - fs[0].real_size(&fs);
    let ds: usize = fs.iter()
        .filter(|f| matches!(f.kind, FileType::Directory(_)))
        .map(|f| f.real_size(&fs))
        .filter(|s| *s + remaining >= 30000000)
        .min().unwrap();
    println!("{ds}");
}

Generated with cgit - Back to sebastiano.tronto.net