Calculating Function

Revision en1, by firedrakesin, 2021-09-13 09:16:08

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?

Tags *800, maths, #implementaion, #adhoc

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English firedrakesin 2021-09-13 09:16:08 433 Initial revision (published)