Hey guys.
I am new to submitting in python, my code is as follows:
n = int(input()) k = int(input())
if(divmod(n,2)[1]==0): stop_odd = n/2 else: stop_odd= n/2+1 if(k<stop_odd): answer = k*2-1 else: k = k-stop_odd answer = k*2 if(k==0): answer=n-1
print(int(answer))
It is for the problem 318A — Even Odds.
Can anyone tell me why i see the exit code, as the code seems to compile and run in my own editor.
Thanks.
can you send submission link?
int(input()) reads a line but in problem n and k are inputted in one line. So, write
n,k = input().split(' '))
. Click.Further question. Is there any information about which packages i can import? This code is unnecessary bad due to a lack of ceil and floor functions. Can i load python math?
Sorry, I don't know python good, I just know very basics of it.
You should be able to import all libraries that come with a default installation of Python. Like math, fractions, ...
Libraries that you have to install afterwards (e.g. with pip) will not work.