Please read the new rule regarding the restriction on the use of AI tools. ×

scriabin's blog

By scriabin, history, 23 months ago, In English
w = int(input())

if w % 2:
    print("NO")
elif w == 2:
    print("NO")
else:
    print("YES")

here is my code, does anyone have recommendations to make it faster

edit; why the downvotes, where is a place i can discuss my code and figure out improvement.

  • Vote: I like it
  • -22
  • Vote: I do not like it

| Write comment?
»
23 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Don't use python.It's the best way :)

  • »
    »
    23 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    thank you, i am going to use C in the future, I am learning it right now, but, I am most comfortable with python atm

    • »
      »
      »
      23 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      If you use pypy, python is enough to solve most, if not all problems on codeforces. I've used mostly python so far (even though I know c++) and it has never failed me. You should only perhaps start worrying about moving to a different language way further down the road.

      As for the speed of your code, it seems good. Maybe a faster approach could be to do w & 1 instead of w % 2, but I think pratically it will rarely make a difference.

»
23 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Cpp costs 0 ms to calculate out the answer