I think for Java solutions the class must be called Solution.
Paul Smith

p...@pollyandpaul.co.uk


On Tue, 7 Apr 2020 at 01:59, kamujula srikar <kamujulasrika...@gmail.com>
wrote:

> Guys , I am getting an runtime error when I try to submit the java code so
> could you please me in solving this.But, When I try to execute on codechef
> java ide works fine .Please help me.
> Thanls inadvance here's the code:
>
> /* package codechef; // don't place package name! */
>
> import java.util.*;
> import java.lang.*;
> import java.io.*;
>
> /* Name of the class has to be "Main" only if the class is public. */
> class Codechef
> {
> public static void main (String[] args) throws java.lang.Exception
> {
>      int t=0;
>      Scanner s=new Scanner(System.in);
>      if(s.hasNext())
>      t=s.nextInt();
>      while(t>0 && t<=100)
>      {
>        int r=0;
>        int rsum=0;
>        int csum=0;
>        int[][] arr;
>        int trace=0;
>        boolean barf=true;
>        if(s.hasNext())
>        r=s.nextInt();
>        if(r>=2 && r<=100)
>        {
>          arr=new int[r][r];
>          for(int i=0;i<r;i++)
>          {
>              for(int j=0;j<r;j++)
>              {
>                  arr[i][j]=s.nextInt();
>              }
>          }
>
>          for(int checker=0;checker<r;checker++)
>          {
>              for(int check=0;check<r;check++)
>              {
>                  if(arr[checker][check]>r && arr[checker][check]<=0)
>                 {
>                     barf=false;
>                 }
>              }
>          }
>          if(barf)
>          {
>          for(int k=0;k<r;k++)
>          {
>             for(int m=0;m<r;m++)
>             {
>                 if(k==m)
>                 {
>                     trace+=arr[k][m];
>                 }
>             }
>          }
>          for(int row=0;row<r;row++)
>          {
>              outer:
>              for(int col=0;col<r;col++)
>              {
>                  for(int cntr=col+1;cntr<r;cntr++)
>                  {
>                  if(arr[row][col]==arr[row][cntr])
>                  {
>                          rsum++;
>                         break outer;
>                  }
>                  }
>              }
>          }
>          for(int row1=0;row1<r;row1++)
>          {
>              inner:
>              for(int col1=0;col1<r;col1++)
>              {
>                  for(int cntr1=col1+1;cntr1<r;cntr1++)
>                  {
>                      if(arr[col1][row1]==arr[cntr1][row1])
>                      {
>                             csum++;
>                             break inner;
>                      }
>                  }
>              }
>          }
>           System.out.println(trace + " " + rsum + " " +csum);
>          }
>        }
>        t--;
>      }
>  }
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/7b7bc0fa-ec27-4eed-8a41-3b00fd81b887%40googlegroups.com
> <https://groups.google.com/d/msgid/google-code/7b7bc0fa-ec27-4eed-8a41-3b00fd81b887%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAJej63%2B2HyL-XyQHLsFgjsnHN0Y8FJNNfEWFEQ0DnJiBbVDcXA%40mail.gmail.com.

Reply via email to