Submission #885962

#TimeUsernameProblemLanguageResultExecution timeMemory
885962karimovOdd-even (IZhO11_oddeven)Pypy 2
0 / 100
20 ms19516 KiB
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 timeMemoryGrader output
Fetching results...