Advertisement
elwinc2799

Untitled

Apr 24th, 2021
787
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. public static void assemblyTime(int a[][], int t[][], int e[], int x[], int len, int route[][]) {
  2.        
  3.         int first = e[0] + a[0][0];
  4.         int second = e[1] + a[1][0];
  5.        
  6.         for (int i = 1; i < len; i++) {
  7.             int up = Math.min(first + a[0][i],second + t[1][i-1] + a[0][i]);
  8.             int down = Math.min(second + a[1][i],first + t[0][i-1] + a[1][i]);
  9.             first = up;
  10.             second = down;
  11.         }
  12.         first += x[0];
  13.         second += x[1];
  14.  
  15.         min = Math.min(first, second);
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement