fork(3) download
  1. import java.lang.Math;
  2. import java.util.Scanner;
  3.  
  4. class submission{
  5. // pyramid[r][c] containts the element in row r and column c for 0 <= c <= r < n.
  6. public static int max_path(int[][] pyramid, int n) {
  7. return 1;
  8. }
  9.  
  10. public static void main(String[] args) {
  11. Scanner in = new Scanner(System.in);
  12. int n = in.nextInt();
  13. int[][] pyramid = new int[n][n];
  14. for (int i=0; i<n; i++)
  15. for (int j=0; j<=i; j++)
  16. pyramid[i][j]=in.nextInt();
  17.  
  18. System.out.println(max_path(pyramid, n));
  19.  
  20. // output solution
  21. for (int i=1; i<n; i++) {
  22. System.out.print("L");
  23. }
  24. System.out.println();
  25. }
  26. }
  27.  
Success #stdin #stdout 0.1s 380736KB
stdin
5
7
3 8
8 1 0
2 7 4 4
4 5 2 6 5
stdout
1
LLLL