Advertisement
Guest User

Untitled

a guest
Feb 28th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. for(int i=0;i<N;i++){
  2. StringTokenizer st1 = new StringTokenizer(r.readLine());
  3. StringTokenizer st2 = new StringTokenizer(r.readLine());
  4. int cost = Integer.parseInt(st1.nextToken());
  5. steps = Integer.parseInt(st1.nextToken());
  6.  
  7. //System.out.println(st2.countTokens());
  8.  
  9. int[] cities = new int[steps];
  10. boolean check = false;
  11. int stops = 0;
  12.  
  13. for(int g=0; g < 3 ; i++){
  14.  
  15. //cities[g] = Integer.parseInt(st2.nextToken());
  16.  
  17. System.out.println(steps);
  18.  
  19. if(check == true){
  20. stops++;
  21. }
  22. if(cities[g] == A){
  23. check = true;
  24. stops++;
  25. }
  26. if(check == true && cities[g] == B){
  27. check = false;
  28. }
  29.  
  30. }
  31.  
  32. if(stops < checkpoints && cost < totalcost){
  33. totalcost = cost;
  34. checkpoints = stops;
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement