lambda
-
[python]백준 팀명 정하기 28114번알고리즘 문제풀이/백준(파이썬) 2023. 5. 30. 22:45
코드 import sys sys.stdin = open("28114.txt", "r") q=[[],[],[]] w=[] for i in range(3): a,b,c=map(str,input().split()) q[i]=a,c w.append(str(int(b)%100))#다른리스트 저장 w.sort() q.sort(reverse=True,key=lambda x:int(x[0]))#q 리스트 0인덱스 int기준 정렬 print(*w,sep="") print(list(q[0][1])[0],list(q[1][1])[0],list(q[2][1])[0],sep="")#성씨 첫번째 글자 #lambda 링크 https://www.acmicpc.net/problem/28114 28114번: 팀명 정하기 첫째 줄에 첫 ..
-
[python]백준 멘토와 멘티 26265번알고리즘 문제풀이/백준(파이썬) 2023. 5. 5. 23:33
코드 import sys sys.stdin = open("26265.txt", "r") n=int(input()) s=[] for i in range(n): s.append(list(input().split())) s.sort(key=lambda x: x[1], reverse=True) s.sort(key=lambda x: x[0]) for a,b in s: print(a,b) #n번 반복 #멘토의 이름/멘티의 이름 리스트에 저장(문자열로) #리스트 정렬 링크 https://www.acmicpc.net/problem/26265 26265번: 멘토와 멘티 서울사이버대학교에는 멘토링 프로그램이 있다. 멘토링 프로그램은 한 명의 멘토(선배학습자)가 여러 명의 멘티(후배학습자)에게 대학 생활에 대한 노하우와 정..