For problem statement at 0-999/200-299/210-219/215/problemE.txt this is a correct solution, but verifier at 0-999/200-299/210-219/215/verifierE.go ends with case 6 failed: expected 18446744073709545952 got 11242
input:716760059 1446482363
exit status 1 can you fix the verifier? package main
import (
"fmt"
)
func count(x uint64) uint64 {
if x < 2 {
return 0
}
var res uint64 = 0
L := 0
for temp := x; temp > 0; temp >>= 1 {
L++
}
for n := 2; n < L; n++ {
E := make([]uint64, n)
for d := 1; d < n; d++ {
if n%d == 0 {
C := uint64(1) << (d - 1)
E[d] = C
for c := 1; c < d; c++ {
if d%c == 0 {
E[d] -= E[c]
}
}
res += E[d]
}
}
}
E := make([]uint64, L)
for d := 1; d < L; d++ {
if L%d == 0 {
P := x >> (L - d)
C := P - (uint64(1) << (d - 1))
var repeated uint64 = 0
for i := 0; i < L/d; i++ {
repeated = (repeated << d) | P
}
if repeated <= x {
C++
}
E[d] = C
for c := 1; c < d; c++ {
if d%c == 0 {
E[d] -= E[c]
}
}
res += E[d]
}
}
return res
}
func main() {
var l, r uint64
if _, err := fmt.Scan(&l, &r); err == nil {
fmt.Println(count(r) - count(l-1))
}
}