Submission #337848

#TimeUsernameProblemLanguageResultExecution timeMemory
337848beksultan04Odd-even (IZhO11_oddeven)Cpython 3
100 / 100
18 ms3072 KiB
a = (input()) a = int(a) if a == 1: print(1) exit(0) l = 1; r = 1e50; while (r-l>1): m = int((l+r)//2) x = int((l+r)//2) x = int((x*(x+1))//2) if int(x) >= int(a): r = m else: l = m x = int((r*(r+1))//2) if x >= a: l = r c = l*l cnt = l*(l+1)//2 c -= (cnt-a)*2 print (c)
#Verdict Execution timeMemoryGrader output
Fetching results...