Hi...actually the values in large input file are passing the limits of
integer. This happened to me when I was coded in java, it worked fine when i
used *long* instead of *int.*

On Fri, Apr 8, 2011 at 9:57 AM, Cody <[email protected]> wrote:

> Hii, all i started codejam yesterday  mine program got solved for
> small in file i dont know why it is not going for large input file
> here is the code , its  problemstatement is here
>
> http://code.google.com/codejam/contest/dashboard?c=351101#
>
> and mine solution i dont know why doest i not work for large input
> file
> [code]
> # To change this template, choose Tools | Templates
> # and open the template in the editor.
>
> class Subarray:
>    length=0
>    start=0
>    end=0
>    array=[]
>    count=0
>
>    def readArray(self,data):
>        self.array=[]
>        temp=data.split(' ')
>        c=0
>        for i in range(0,len(temp),1):
>            c=int(temp[i].strip())
>            self.array.append(c)
>        return self.array
>    def process(self,data,value):
>        flag=False
>        number=0
>        result=0
>        tempnumber=value
>        print(data)
>        print(value)
>        for i in range(0,len(data),1):
>
>            value=tempnumber
>            number=value-data[i]
>
>
>            if number in data:
>
>                result=data.index(number)
>                if(result==i):
>                    flag=True
>                    continue
>                else:
>                     if flag is True:
>                         return(result+1),(i+1)
>                     else:
>                          return (i+1),(result+1)
>                          break
>
>
> def main():
>    c=0
>    f=open('d:\\practice.in')
>    output=open('d:\\ouput.out','w')
>    temp=f.readline().strip()
>    c=int(temp)
>
>    s=Subarray()
>
>    for i in range(0,c,1):
>        j=0
>        temp=f.readline()
>
>        x=int(temp.strip())
>        temp=f.readline()
>
>        temp=f.readline()
>
>        d=s.readArray(temp)
>        result=s.process(d, int(x))
>        j=i+1
>        temp='Case #'+str(j)+': '+str(result[0])+'
> '+str(result[1]).strip()
>        output.write(temp)
>        output.write('\n')
>        output.flush()
>
>        print(temp)
>    output.close()
>
>
> main()
> [/code]
> please help me out in mine first problem
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.

Reply via email to