Xiang Li

import math
import cmath
import string
import sys
import bisect
from queue import Queue,LifoQueue,PriorityQueue
from itertools import permutations,combinations
from collections import deque,Counter

if __name__=='__main__':
    

    a = [[2,3],[4,1],[2,8],[2,1],[3,4]]
    b = sorted(a,key=lambda x: (x[0], -x[1]))
    print (b)
    

你可能感兴趣的:(算法)