ohk... didn't know that. On Friday, October 21, 2011, Carlos Guia <[email protected]> wrote: > @Virkam > The question is related a TopCoder problem and the error posted is given by the testing system. > The statement is here: http://community.topcoder.com/stat?c=problem_statement&pm=1677 > There you can see that the Definition section specifies that a class named Bonuses should contain a public method called getDivision. > > I admit the OP failed to clearly express this situation, only a small mention to a so called "srm-3" and that's it. > Carlos Guía > > > On Fri, Oct 21, 2011 at 12:44 AM, Satyajit Bhadange < [email protected]> wrote: > > @mandeep > > please write code in below method signature.Write your logic inside this method and return int[] .if your logic is correct you will pass All system test. > > > public class > > Bonuses{ > > public int[] getDivision(int[] points){ > > return null; > > } > > } > > > > > > > > On Thu, Oct 20, 2011 at 5:48 PM, 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.le > > -- > 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.
