# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
337848 | beksultan04 | Odd-even (IZhO11_oddeven) | Cpython 3 | 18 ms | 3072 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.
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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |