package com.thinker.bishi.other; import java.util.*; /** * @author lzh */ public class Main { private static int last = 0; private static List tmp = new ArrayList(); private static List result ; private static Map tmps = new HashMap<>(); private static int check(int sum,int[] lines,int[] init){ boolean flag = lines[1] <= init[1] && lines[0] == last; if(flag){ sum += lines[2]; last = lines[1]; tmp.add(last); } return sum; } public static void main(String[] args) { Scanner in =new Scanner(System.in); String[] first = in.nextLine().split(" "); int[] init = new int[2]; int sum = 0; int index = 1; for(int i=0;i<2;i++){ init[i] = Integer.parseInt(first[i]); } last = init[0]; tmp.add(last); while (in.hasNextLine()){ String[] lines = in.nextLine().split(" "); int[] linesInt = new int[3]; for(int i=0;i<3;i++){ linesInt[i] = Integer.parseInt(lines[i]); } tmps.put(index,linesInt); index += 1; } int min = 0; for(int i=0;i"); } } } }