×

# WRONG WRONG WRONG : why I'm getting Wrong Answer even my code is correct ? - RAINBOWA

 0 T=int(raw_input()) for i in range(T): N=int(raw_input()) L=map(int,raw_input().split()) sum1=0 sum2=0 answer =1 for j in range(N): if N%2==0 : if j<=N/2-1 : sum1=sum1+L[j] else : sum2=sum2+L[j] if jN/2 : if L[j]!=L[j-1]-1 and L[j-1]!=L[j] : answer = 0 else : if jN/2 : sum2 = sum2+L[j] if jN/2 : if L[j]!=L[j-1]-1 and L[j-1]!=L[j] : answer = 0 if answer == 0 or sum1!=sum2 : print "no" else : print "yes"  question link : https://www.codechef.com/problems/RAINBOWA asked 20 Dec '18, 01:48 1 accept rate: 0%
 toggle preview community wiki:
Preview

By Email:

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:

×3,710
×1,901
×1,615
×846
×41

question asked: 20 Dec '18, 01:48

question was seen: 39 times

last updated: 20 Dec '18, 01:48