Submission #1019655

#TimeUsernameProblemLanguageResultExecution timeMemory
1019655MinbaevOdd-even (IZhO11_oddeven)Pypy 2
0 / 100
21 ms19264 KiB
n = int(input()) l = 1 r = 1e51 ans = -1 while l <= r: mid = (l + r) // 2 sum = mid * (mid + 1) // 2 if sum >= n: ans = mid r = mid - 1 else: l = mid + 1 # Correct calculation for 'val' val = (ans * (ans + 1) // 2 - n) * 2 + (ans - 1) print(val)

Compilation message (stderr)

Sorry: IndentationError: unexpected indent (oddeven.py, line 1)
#Verdict Execution timeMemoryGrader output
Fetching results...