Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Apr 8th, 2020 133 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  private void validateEdges() {
  2.             int[] position = new int[k];
  3.             Arrays.fill(position, s);
  4.             for (int i = 0; i < days; i++) {
  5.                 ships.clear();
  6.                 for (int j = 0; j < k; j++) {
  7.                     for (Edge edge : g.get(position[j]).edges){
  8.                         if (edge.flow >= 1) {
  9.                             edge.flow -= 1;
  10.                             if (position[j] + n != edge.to) {
  11.                                 ships.add(new Pair(j, edge.to % n));
  12.                             }
  13.                             position[j] = edge.to;
  14.                             break;
  15.                         }
  16.                     }
  17.                 }
  18.  
  19.                 System.out.print(ships.size() + " ");
  20.                 for (Pair ship : ships) {
  21.                     System.out.print(ship.first + 1 + " " + (ship.second + 1) + " ");
  22.                 }
  23.                 System.out.println();
  24.             }
  25.  
  26.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top