Skip to content

Commit 773a6ae

Browse files
committed
add abc400c.rs
1 parent 4711bcc commit 773a6ae

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/abc/abc400c.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
use proconio::input;
3+
use proconio::marker::*;
4+
use std::marker::PhantomData;
5+
use std::cmp::*;
6+
use std::collections::*;
7+
use num_integer::sqrt;
8+
9+
fn main() {
10+
input! {
11+
n:usize,
12+
}
13+
14+
let mut result = 0;
15+
let mut a_pow = 1;
16+
for _ in 1..=60 {
17+
a_pow *= 2;
18+
if n < a_pow {
19+
continue
20+
}
21+
let b = sqrt(n as u64 / a_pow as u64);
22+
result += (b+1)/2;
23+
}
24+
println!("{result}");
25+
26+
}

0 commit comments

Comments
 (0)