# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
885962 | 2023-12-11T08:52:32 Z | karimov | Odd-even (IZhO11_oddeven) | PyPy | 20 ms | 19516 KB |
import math n = int(input()) def odd_even(n): x = math.ceil((8 * n + 1) ** 0.5) // 2 d = x & 1 if d: x -= 1 return (d ** 2 * 4 + 1) + (2 * (n - (x * (x + 1) // 2) - 1)) else: x >>= 1 return (d ** 2 * 4 + 4 * d + 2) + (2 * (n - (x * (x + 1) // 2) - 1)) result = odd_even(n) print(int(result))
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 20 ms | 19516 KB | Execution failed because the return code was nonzero |
2 | Halted | 0 ms | 0 KB | - |