Submission #337863

#TimeUsernameProblemLanguageResultExecution timeMemory
337863tengiz05Odd-even (IZhO11_oddeven)Cpython 3
100 / 100
17 ms2924 KiB
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 timeMemoryGrader output
Fetching results...