摘要: /** * Definition for undirected graph. * class UndirectedGraphNode { * int label; * ArrayList<UndirectedGraphNode> neighbors; * UndirectedGraphNode(int x) { label = x; neighbors = new ArrayList<Undire 阅读全文
posted @ 2019-08-10 18:38 紫色的雪 阅读(143) 评论(0) 推荐(0) 编辑
摘要: List<Integer> list = new ArrayList<>(); for(int i= 0; i < gas.length; i++){ if(gas[i]>=cost[i]){ list.add(i); } } for(int n = 0; n<list.size(); n++ ){ int j = list.get(n); int sum = gas[j]; //System.o 阅读全文
posted @ 2019-08-10 13:38 紫色的雪 阅读(1990) 评论(0) 推荐(0) 编辑