This is the code I wrote for the problem 'Calculating Function'
g=int(input()) if g%2==0: n=g/2 print(int((n*(n+1))-(n*n))) else: n=g//2; c=n+1 print(int((n*(n+1))-(c*c)))
It is correct but when I submitted it, it is showing wrong answer on test case 5. So I asked my friend and he did submit my code on codeforces from his account and it got accepted on his account. Why so?
n = g / 2
. In Pythonn
would be float pointing number which have not nessecary precision, so you got WA.