Created
August 6, 2013 01:36
-
-
Save igauravsehrawat/6161274 to your computer and use it in GitHub Desktop.
getting error at line 46
error:Exception in thread "main" java.lang.NullPointerException at com.company.lelemon.main(lelemon.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAc…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.company; | |
import java.util.Scanner; | |
/** | |
* Created with IntelliJ IDEA. | |
* User: g | |
* Date: 8/5/13 | |
* Time: 7:18 AM | |
* To change this template use File | Settings | File Templates. | |
*/ | |
public class lelemon { | |
public static void main(String[] args){ | |
//input | |
/* sample input | |
2 | |
3 3 | |
0 2 1 | |
3 1 2 3 | |
1 7 | |
2 4 7 | |
4 7 | |
0 1 3 0 0 1 0 0 | |
1 7 | |
3 9 4 5 | |
7 1 2 3 4 5 6 7 | |
1 1 | |
*/ | |
int testcases;int n,m; | |
Scanner scan=new Scanner(System.in); | |
testcases=scan.nextInt(); | |
for(int i=0;i<testcases;i++){ | |
n= scan.nextInt(); | |
m=scan.nextInt(); | |
int[] sequence=new int[m]; | |
for(int j=0;j<m;j++){ | |
sequence[j]=scan.nextInt(); | |
} | |
int[][] lemonade=new int[n][]; | |
for(int k=0;k<=n;k++){ | |
int nolemonade=scan.nextInt(); | |
for(int l=0;l<nolemonade;l++){ | |
lemonade[k][l] =scan.nextInt(); | |
} | |
} | |
} | |
System.out.println("lelemon_gone"); } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment