I don't think that might be the problem... If we see the main method she has written, the function called is getDivison which is the same method being declared.
@Mandeep: Are you sure this is the exact copy of the code you are executing? On Friday, October 21, 2011, Carlos Guia <[email protected]> wrote: > It's hard to spot, but you have read a little bit more carefully. > Your method is named "getDivison" instead of "getDivision". > > Carlos Guía > > > On Thu, Oct 20, 2011 at 7:48 AM, mandeep <[email protected]> wrote: > > getting this error again and again... > > Correct Return Value: No > > Execution Time: 0.000s > > Could not find the necessary method. > java.lang.NoSuchMethodException: Bonuses.getDivision([I) > > Standard Output: > > > Standard Error: > > And here is code:- > > public class Bonuses { > static int i,j,temp,avg=0,sum=0,l=0; > //static String str="555555"; > static int[] res=new int[20]; > static int[] tar={1,2,3,4,5}; > static int [] st=new int[20]; > //st=Bonuses.getDivison(res); > > public int[] getDivison(int[] points) > { > for(l=0;l<points.length;l++) > { > avg+=points[l]; > } > for(j=0;j<points.length;j++) > { > res[j]=points[j]; > res[j]=res[j]*100/avg; > points[j]=res[j]; > sum+=points[j]; > //System.out.print(points[j]); > } > //System.out.println(sum); > for(i=0;i<points.length;i++) > > for(j=i+1;j<points.length;j++) > { > if(res[j]>res[i]) > { > temp=res[j]; > res[j]=res[i]; > res[i]=temp; > } > } > for(i=0;i<points.length;i++) > { > for(j=0;j<points.length&&sum!=100;j++) > { > if(res[i]==points[j]) > { > points[j]+=1; > sum++; > } > } > } > return points; > } > public static void main(String as[]) > { > st=Bonuses.getDivison(tar); > for(i=0;i<tar.length;i++) > System.out.print(st[i]+" "); > } > } > > > > On Tue, Oct 18, 2011 at 11:29 PM, Vikram Gaur <[email protected]> wrote: > > well in your earlier code you had declared getDivision as static method and hence calling it with an object would be wrong. correct way would be to call just the function directly. > > But with this new code you have given i think it should work fine. > > > On Tue, Oct 18, 2011 at 11:24 PM, mandeep <[email protected]> wrote: > > Well this code is written using main method. I have compiled this code many times,even compiled successfully, but i am getting 1 error during testing in topcoder arena. S > But error is:-there is no such method Bonuses.getDivison(int[] ) > So whether you main() method or not,i am getting this error.Or you can provide me another solution to this problem. > Thanks...!!! > > > public class Bonuses > { > static int i,j,temp,avg=0,sum=0,l=0; > static int res[]=new int[20]; > static int st[]=new int[20]; > static int pt={1,2,3,4,5}; > public int[] getDivison(int[] points) > { > for(l=0;l<points.length;l++) //firstly find out the sum > { > avg+=points[l]; > } > for(j=0;j<points.length;j++) > { > res[j]=points[j]; //then in res[] array result is stored.and sum is find out > res[j]=res[j]*100/avg; > points[j]=res[j]; > sum+=points[j]; > //System.out.print(points[j]); > } > //System.out.println(sum); > for(i=0;i<points.length;i++) > > for(j=i+1;j<points.length;j++) //here element are sorted and store in res[] > { > if(res[j]>res[i]) > { > temp=res[j]; > res[j]=res[i]; > res[i]=temp; > } > } > for(i=0;i<points.length;i++) //then we compare two array res[],points[] and larger value is increased by // 1 until sum=100 > { > for(j=0;j<points.length&&sum!=100;j++) > { > if(res[i]==points[j]) > { > points[j]+=1; > sum++; > } > } > } > return points; > > -- > You received this message because you are subscribed to the Google Groups "Google Code Jam" 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. > -- Thanks and Regards Vikram Gaur Software Engineer Samsung Engineering Labs, Noida +91-9818540102 "Since human beings themselves are not fully debugged yet, there will be bugs in your code no matter what you do." - Chris Mason -- You received this message because you are subscribed to the Google Groups "Google Code Jam" 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.
