# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
523348 | Pety | Odd-even (IZhO11_oddeven) | Cpython 3 | 20 ms | 2836 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.
# Online Python - IDE, Editor, Compiler, Interpreter
N = int(input())
st = 1; dr = pow(10, 50);
ans = 0;
while st <= dr:
mij = (st + dr) // 2
if mij * (mij+1) // 2 >= N:
ans = mij;
dr = mij - 1;
else:
st = mij + 1;
if ans % 2 == 1:
print(2 * (N - ans // 2 - 1) + 1)
else:
print(2 * (N - ans // 2));
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |