You are not logged in. Please login at www.codechef.com to post your questions!

×

why i'm getting runtime error(NZEC) in my python code which is running without any errors in my system and giving right results in my system?

test = int(input())

for i in range(test):
    s = input()
    ate = 0
    snakes = 0
    mongoose = 0
    count = 0
    for i in s:
        if s[count] == 'm':
            mongoose += 1
            if(s[count-1] == 's'):
                ate+= 1
            elif (s[count+1] == 's'):
                ate +=1
        else:
            snakes +=1
        count += 1
        snakes -= ate
    if snakes > mongoose:
        print("snakes")
    elif mongoose > snakes:
        print("mongooses")
    else:
        print("tie")

asked 20 Jun '17, 02:06

moeed786's gravatar image

2★moeed786
1
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×545
×281
×49

question asked: 20 Jun '17, 02:06

question was seen: 229 times

last updated: 20 Jun '17, 02:06