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

×

# Nzec error while submitting ?

 0 Nzec error while submitting ? While it runs well in my pc ? This question is marked "community wiki". asked 16 Sep '17, 21:18 1●1 accept rate: 0% // My code is import java.lang.*; import java.util.Scanner; class Temple { public static boolean check() { Scanner s = new Scanner(System.in); int i=0,n=0; int arr[]= new int[100]; n=s.nextInt(); for(i=0;i100) return false; int h=n/2; for(i=1;i<=h;i++) { if((arr[h-i]!=arr[h+i])||((arr[h-i]+1)!=(arr[h-i+1]))) return false; } return true; } (16 Sep '17, 21:20) // And its main. public static void main(String[] args) { Scanner sc = new Scanner(System.in); int s=0; int i=0; s=sc.nextInt(); for(i=0;i

 0 NZEC error is basically NON ZERO EXIT CODE. In java, the prime reason for this is IndexOutOfBounds Exception, whether it may be string index or array... Although NZEEC is given by any Exception thrown, IndexOutOfBounds Exception is prime reason for probably 95% NZEC submissions... Hope this clarfies any doubt.... Please UPVOTE and Accept the answer if you find this helpful... answered 16 Sep '17, 21:23 3.9k●27●91 accept rate: 22%
 0 The problem TEMPLELA has a simpler solution. When N is even, answer is invalid as there's no possible heights satisfying all requirements... When N is odd, observe ans for Odd values of N N = 3: 1 2 1 N = 5: 1 2 3 2 1 N = 7: 1 2 3 4 3 2 1 A single loop in java int N = in.nextInt(); int[] height = new int[N]; boolean ans = true; for(int i = 0; i
 toggle preview community wiki:
Preview

### Follow this question

By Email:

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

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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:

×1,302

question asked: 16 Sep '17, 21:18

question was seen: 212 times

last updated: 16 Sep '17, 22:03