This comment is hidden because it contains spoiler information about the solution
The time complexity of the algorithm in this solution is O(n² log n).
Correct operation of the function in this solution is not guaranteed.
Input: 1125899940397056 | Expected: 1125899906842624 | Output: 1125899973951489
Input: 4900000070000000 | Expected: 4900000000000000 | Output: 4900000140000001
Input: 9007199041343960 | Expected: 9007198946437696 | Output: 9007199136250225
The total number of such cases (for safe integers) is over 72 million.
This is perhaps the first such integer: 1125899940397056. For this input, the answer should be 1125899906842624, but it gives 1125899973951489.
And the total number of such safe integers is tens of millions.
Input: 117649 | Harmonic mean: 6.000007285602921 | Expected: false | Output: true
Input: 1953125 | Harmonic mean: 8.000000819200084 | Expected: false | Output: true
Input: 4782969 | Harmonic mean: 10.000000696917242 | Expected: false | Output: true
Input: 8388608 | Harmonic mean: 12.00000071525578 | Expected: false | Output: true
Loading collection data...
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
The time complexity of the algorithm in this solution is O(n² log n).
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Correct operation of the function in this solution is not guaranteed.
Input: 1125899940397056 | Expected: 1125899906842624 | Output: 1125899973951489
Input: 4900000070000000 | Expected: 4900000000000000 | Output: 4900000140000001
Input: 9007199041343960 | Expected: 9007198946437696 | Output: 9007199136250225
The total number of such cases (for safe integers) is over 72 million.
This is perhaps the first such integer: 1125899940397056. For this input, the answer should be 1125899906842624, but it gives 1125899973951489.
And the total number of such safe integers is tens of millions.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Input: 117649 | Harmonic mean: 6.000007285602921 | Expected: false | Output: true
Input: 1953125 | Harmonic mean: 8.000000819200084 | Expected: false | Output: true
Input: 4782969 | Harmonic mean: 10.000000696917242 | Expected: false | Output: true
Input: 8388608 | Harmonic mean: 12.00000071525578 | Expected: false | Output: true
Loading more items...