Skip to content

Commit

Permalink
AC atcoder/abc357/d
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Jun 9, 2024
1 parent a62058d commit 255c042
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions atcoder/abc357/d/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// WA
// AC

// https://atcoder.jp/contests/abc357/tasks/abc357_d

Expand All @@ -9,7 +9,8 @@ fn main() {

// Vn = n * (1 + 10^k + ... + 10^(k (n - 1)))
// = n * (10^(k n) - 1) / (10^k - 1)
let result = Mint(n) * (Mint(10).pow(k).pow(n) - Mint(1)) / (Mint(10).pow(k) - Mint(1));
let result =
Mint(n % MODULO) * (Mint(10).pow(k).pow(n) - Mint(1)) / (Mint(10).pow(k) - Mint(1));
println!("{}", result.0);
}

Expand Down

0 comments on commit 255c042

Please sign in to comment.