Submission #523239

#TimeUsernameProblemLanguageResultExecution timeMemory
523239redstonegamer22Odd-even (IZhO11_oddeven)Cpython 3
0 / 100
13 ms2828 KiB
import math n = int(input()) m = math.isqrt(2 * n) - 5 while m <= 0 or (m + 1) * (m + 2) // 2 <= n: m = m + 1 # print(m) a = m * (m + 1) // 2 + m * (m - 1) // 2 b = n - m * (m + 1) // 2 ans = a + 2 * b - 1 print(ans)
#Verdict Execution timeMemoryGrader output
Fetching results...