#美团笔试# 老哥们送外卖这个哪里错了,直接排序不行吗public class Main { static class Pay { int vals; int weight; int id; public Pay(int vals, int weight, int id) { this.vals = vals; this.weight = weight; this.id = id; } int pay() { return vals + weight * 2; } } public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(), m = sc.nextInt(); Pay[] pays = new Pay[n]; for (int i = 0; i pays[i] = new Pay(sc.nextInt(), sc.nextInt(), i); } Arrays.sort(pays, (p1, p2) -> { int t = p2.pay() - p1.pay(); if (t == 0) { return p1.id - p2.id; } return t; }); for (int i = 1; i System.out.println((pays[i].id + 1) + " "); } }}