Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Error de compilación
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java public class Solution{ ^ 1 error |
||
#2 |
Error de compilación
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java public class Solution{ ^ 1 error |
||
#3 |
Error de compilación
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java public class Solution{ ^ 1 error |
||
#4 |
Error de compilación
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java public class Solution{ ^ 1 error |
||
#5 |
Error de compilación
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java public class Solution{ ^ 1 error |
||
#6 |
Error de compilación
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java public class Solution{ ^ 1 error |
||
#7 |
Error de compilación
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java public class Solution{ ^ 1 error |
||
#8 |
Error de compilación
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java public class Solution{ ^ 1 error |
||
#9 |
Error de compilación
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java public class Solution{ ^ 1 error |
||
#10 |
Error de compilación
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java public class Solution{ ^ 1 error |
||
#11 |
Error de compilación
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java public class Solution{ ^ 1 error |
||
#12 |
Error de compilación
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java public class Solution{ ^ 1 error |
||
#13 |
Error de compilación
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java public class Solution{ ^ 1 error |
||
#14 |
Error de compilación
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java public class Solution{ ^ 1 error |
||
#15 |
Error de compilación
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java public class Solution{ ^ 1 error |
||
#16 |
Error de compilación
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java public class Solution{ ^ 1 error |
||
#17 |
Error de compilación
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java public class Solution{ ^ 1 error |
||
#18 |
Error de compilación
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java public class Solution{ ^ 1 error |
||
#19 |
Error de compilación
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java public class Solution{ ^ 1 error |
||
#20 |
Error de compilación
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java public class Solution{ ^ 1 error |
import java.util.Scanner; public class Solution{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); boolean loop = false; int [] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); } int left = 0, right = 0, total = 0; for (int i = 0; i < n; i++) { total += a[i]; } for (int p = 0; p < n; p++) { right = total - left; if (left > 0 && right < 0) { System.out.println(p); loop = true; break; } left += a[p]; //right -= a[p]; } if (!loop) { System.out.println("Impossible"); } } }