Skip to content

Commit

Permalink
arc127 a
Browse files Browse the repository at this point in the history
  • Loading branch information
bouzuya committed Nov 1, 2021
1 parent 6bed8c4 commit 894d989
Show file tree
Hide file tree
Showing 9 changed files with 251 additions and 0 deletions.
161 changes: 161 additions & 0 deletions arc127/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions arc127/Cargo.toml
@@ -0,0 +1,14 @@
[package]
name = "arc127"
version = "0.1.0"
edition = "2018"

# dependencies added to new project
[dependencies]
num = "=0.2.1"
proconio = { version = "=0.3.6", features = ["derive"] }
superslice = "=1.0.0"

[profile.release]
lto = true
panic = 'abort'
1 change: 1 addition & 0 deletions arc127/rust-toolchain
@@ -0,0 +1 @@
1.42.0
25 changes: 25 additions & 0 deletions arc127/src/bin/a.rs
@@ -0,0 +1,25 @@
use proconio::input;

fn main() {
input! {
n: usize,
};
let mut ans = 0_usize;
for l in 1.. {
let mut b = 0_usize;
for j in 0..l {
b += 10_usize.pow(j as u32);
}
if b > n {
break;
}

let mut t = b + 1;
while b <= n {
ans += n.min(t - 1) + 1 - b;
b *= 10;
t *= 10;
}
}
println!("{}", ans);
}
10 changes: 10 additions & 0 deletions arc127/src/bin/b.rs
@@ -0,0 +1,10 @@
use proconio::{input, marker::Usize1};

fn main() {
input! {
n: usize,
a: [Usize1; n],
};
let ans = n - a.len();
println!("{}", ans);
}
10 changes: 10 additions & 0 deletions arc127/src/bin/c.rs
@@ -0,0 +1,10 @@
use proconio::{input, marker::Usize1};

fn main() {
input! {
n: usize,
a: [Usize1; n],
};
let ans = n - a.len();
println!("{}", ans);
}
10 changes: 10 additions & 0 deletions arc127/src/bin/d.rs
@@ -0,0 +1,10 @@
use proconio::{input, marker::Usize1};

fn main() {
input! {
n: usize,
a: [Usize1; n],
};
let ans = n - a.len();
println!("{}", ans);
}
10 changes: 10 additions & 0 deletions arc127/src/bin/e.rs
@@ -0,0 +1,10 @@
use proconio::{input, marker::Usize1};

fn main() {
input! {
n: usize,
a: [Usize1; n],
};
let ans = n - a.len();
println!("{}", ans);
}
10 changes: 10 additions & 0 deletions arc127/src/bin/f.rs
@@ -0,0 +1,10 @@
use proconio::{input, marker::Usize1};

fn main() {
input! {
n: usize,
a: [Usize1; n],
};
let ans = n - a.len();
println!("{}", ans);
}

0 comments on commit 894d989

Please sign in to comment.