Thursday, February 28, 2013

NOT A TRI (codechef problem unsolved)


from sys import stdin,stdout
from collections import deque
def main():
    new_line=deque()
    line=stdin.readline().split()
    while int(line[0]) != 0:
        for i in line:
            new_line.append(int(i))
        gab=new_line.popleft()
        highest_number=max(new_line)
        new_line.remove(highest_number)
        sum_two_sides=0
        count=0
        j=0
        while j<=len(new_line):
            sum_two_sides=new_line(j)+new_line(j+1)
            if sum_two_sides > highest_number:
                count=count+1
                j=j-1
        line=stdin.readline().split()
        print(count)
main() 
Here I've posted the code I don't know what's wrong if some body happens to solve this help me out :)) http://www.codechef.com/status/NOTATRI,cybercam check my submissions :)) Link to the problem My incomplete Solution: