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

×

This code is giving me NZEC error at line 12.please help me

def bound_solid(i,j): if (i-1)>=0: l=(i-1) else: l=n-1 if (i+1)<=n-1: u=(i+1) else: u=0 return(l,u)

T=input()#the error is at this line

T=int(T) for i in range (T): n=int(input()) atk=list(map(int,input().split(" "))) defn=list(map(int,input().split(" "))) max_defns=0

for j in range(n):
    l,u=bound_solid(j,n)
    if(defn[j]>(atk[l]+atk[u])):
        if(defn[j]>max_defns):
            max_defns=defn[j]

if(max_defns>0):
    print(max_defns)
else:
    print(-1)

asked 18 Feb, 20:12

rajasai123's gravatar image

0★rajasai123
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:

×27

question asked: 18 Feb, 20:12

question was seen: 39 times

last updated: 18 Feb, 20:12