请问这个a[i] > k % (long long)pow(10, int(log10(a[i]) + 1))为什么要这样判断,还有
ans += upper_bound(a + i + 1, a + n + 1, k / (long long)pow(10, int(log10(a[i]) + 1)) - 1) - 1 - a - i;
ans += upper_bound(a + 1, a + i, k / (long long)pow(10, int(log10(a[i]) + 1)) - 1) - 1 - a;
ans += upper_bound(a + i + 1, a + n + 1, k / (long long)pow(10, int(log10(a[i]) + 1))) - 1 - a - i;
ans += upper_bound(a + 1, a + i, k / (long long)pow(10, int(log10(a[i]) + 1))) - 1 - a;为什么一个是k / (long long)pow(10, int(log10(a[i]) + 1)) - 1,一个是k / (long long)pow(10, int(log10(a[i]) + 1)) + 1
2024-01-18 15:24:03