Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::io::{self, BufRead};
- fn main() {
- let stdin = io::stdin();
- let mut iter = stdin.lock().lines();
- let binding = iter.next().unwrap().unwrap();
- let times = binding
- .split_whitespace()
- .skip(1)
- .map(|x| x.parse::<u32>().unwrap());
- let binding = iter.next().unwrap().unwrap();
- let dists = binding
- .split_whitespace()
- .skip(1)
- .map(|x| x.parse::<u32>().unwrap());
- let mut races = times.zip(dists);
- let mut res = 1;
- for (time, dist) in races {
- let mut ct = 0;
- for i in (1..time) {
- if i * (time - i) > dist {
- ct += 1;
- }
- }
- res *= ct;
- }
- print!("{}", res);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement