Submission #1019654

#TimeUsernameProblemLanguageResultExecution timeMemory
1019654MinbaevOdd-even (IZhO11_oddeven)Pypy 3
0 / 100
46 ms20148 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...