We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4711bcc commit 773a6aeCopy full SHA for 773a6ae
src/abc/abc400c.rs
@@ -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