This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pub mod input { | |
| use std::cell::RefCell; | |
| use std::fmt::Debug; | |
| use std::io::{stdin, BufRead, BufReader, Stdin}; | |
| use std::str::{FromStr, SplitWhitespace}; | |
| thread_local!( | |
| pub static STDIN_SOURCE: RefCell<Source> = RefCell::new(Source { | |
| stdin: BufReader::new(stdin()), | |
| tokens: "".split_whitespace(), | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use rand::prelude::*; | |
| const N: usize = 20; | |
| const M: usize = 100; | |
| fn main() { | |
| let mut solver = Solver::new(); | |
| solver.solve(); | |
| solver.out(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extern crate anyway_ord; | |
| use { | |
| crate::{command::*, state::*}, | |
| anyway_ord::AnywayOrd, | |
| itertools::iproduct, | |
| rand::prelude::*, | |
| std::collections::HashMap, | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use { | |
| crate::{consts::*, info::*}, | |
| rand::Rng, | |
| }; | |
| pub const NONE: usize = !0; | |
| #[derive(PartialEq, Debug)] | |
| pub struct CellsBits { | |
| pub rich: [u64; 4], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn main() { | |
| proconio::input!(n: usize, l: u32, k: usize, a: [u32; n]); | |
| let can_get = |score: u32| { | |
| a.iter() | |
| .chain(Some(&l)) | |
| .scan((0, 0), |(cum, prev), &a| { | |
| *cum += a - *prev; | |
| *prev = a; | |
| if *cum >= score { |