# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
337863 | tengiz05 | Odd-even (IZhO11_oddeven) | Cpython 3 | 17 ms | 2924 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
n = int(input())
l=0
r=n
while l+1 < r:
mid = (l+r)//2
if mid*(mid+1)//2 < n:
l = mid
else :
r = mid
lst = l*(l+1)//2
start = lst*2-l+1
start += (n-lst-1)*2
print(start)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |