# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
337865 | BY_KUTBILIM | Odd-even (IZhO11_oddeven) | Cpython 3 | 20 ms | 2816 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):
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 + 1
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... |