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 e476467 commit ce34b95Copy full SHA for ce34b95
examples/abc129-f.rs
@@ -22,7 +22,8 @@ fn main() {
22
MOD.with(|cell| cell.set(m));
23
24
let count = |d| -> _ {
25
- let count = |sup: u64| cmp::min(sup.saturating_sub(a + 1) / b + u64::from(b < sup), l);
+ let count =
26
+ |above: u64| cmp::min(above.saturating_sub(a + 1) / b + u64::from(b < above), l);
27
count(10u64.pow(d)) - count(10u64.pow(d - 1))
28
};
29
@@ -65,12 +66,8 @@ thread_local! {
65
66
struct Z(u64);
67
68
impl Z {
- fn checked(mut val: u64) -> Self {
69
- let modulus = MOD.with(Cell::get);
70
- if val >= modulus {
71
- val %= modulus;
72
- }
73
- Self(val)
+ fn checked(val: u64) -> Self {
+ Self(val % MOD.with(Cell::get))
74
}
75
76
0 commit comments