solutions: 577A
This commit is contained in:
parent
901163d6b5
commit
8151140245
1 changed files with 21 additions and 0 deletions
21
solutions/rust/src/bin/577A.rs
Normal file
21
solutions/rust/src/bin/577A.rs
Normal file
|
@ -0,0 +1,21 @@
|
|||
use std::io;
|
||||
|
||||
fn main() {
|
||||
let mut s = String::new();
|
||||
io::stdin().read_line(&mut s).unwrap();
|
||||
|
||||
let a: Vec<f64> = s.split_whitespace().map(|d| d.parse::<f64>().unwrap()).collect();
|
||||
|
||||
let n = a[0];
|
||||
let x = a[1];
|
||||
|
||||
let mut count = 0;
|
||||
for i in 1..=(n.trunc() as u64) {
|
||||
let pos = x / (i as f64);
|
||||
if pos.fract() == 0. && pos <= n {
|
||||
count += 1
|
||||
}
|
||||
}
|
||||
|
||||
println!("{}", count);
|
||||
}
|
Loading…
Reference in a new issue