반응형 Python216 python - baekjoon - 10814 https://www.acmicpc.net/problem/10814 10814번: 나이순 정렬 온라인 저지에 가입한 사람들의 나이와 이름이 가입한 순서대로 주어진다. 이때, 회원들을 나이가 증가하는 순으로, 나이가 같으면 먼저 가입한 사람이 앞에 오는 순서로 정렬하는 프로그램을 � www.acmicpc.net # @Author YoungMinKim # baekjoon import sys N = int(sys.stdin.readline()) ls = [] for i in range(N): x,y = sys.stdin.readline().split() ls.append((int(x),i,y)) for a,b,c in sorted(ls): print(a,c) 2020. 9. 5. baekjoon - python - 1181 https://www.acmicpc.net/problem/1181 1181번: 단어 정렬 첫째 줄에 단어의 개수 N이 주어진다. (1≤N≤20,000) 둘째 줄부터 N개의 줄에 걸쳐 알파벳 소문자로 이루어진 단어가 한 줄에 하나씩 주어진다. 주어지는 문자열의 길이는 50을 넘지 않는다. www.acmicpc.net # @Author YoungMinKim # baekjoon import sys N = int(sys.stdin.readline()) dic = [] for _ in range(N): x = sys.stdin.readline().split()[0] dic.append((len(x),x)) sort_dic = sorted(set(dic)) for i in sort_dic: print(i[1]) 2020. 9. 5. baekjoon - python - 10773 https://www.acmicpc.net/problem/10773 10773번: 제로 첫 번째 줄에 정수 K가 주어진다. (1 ≤ K ≤ 100,000) 이후 K개의 줄에 정수가 1개씩 주어진다. 정수는 0에서 1,000,000 사이의 값을 가지며, 정수가 "0" 일 경우에는 가장 최근에 쓴 수를 지우고, 아닐 경 www.acmicpc.net class stack: def __init__(self): self.tmp = [] def push(self,x): self.tmp.append(x) def pop(self): if self.size() == 0: return -1 else: return self.tmp.pop(-1) def size(self): return len(self.tmp) def emp.. 2020. 9. 5. baekjoon - python - 10952 https://www.acmicpc.net/problem/10952 10952번: A+B - 5 두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오. www.acmicpc.net # @Author YoungMinKim # baekjoon while True: a,b= map(int,input().split()) if a == b == 0: break print(a+b) 2020. 9. 5. baekjoon - python - 10951 https://www.acmicpc.net/problem/10951 10951번: A+B - 4 두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오. www.acmicpc.net # @Author YoungMinKim # baekjoon while True: try: a,b = map(int,input().split()) print(a+b) except: break 2020. 9. 5. baekjoon - python - 10950 https://www.acmicpc.net/problem/10950 10950번: A+B - 3 두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오. www.acmicpc.net # @Author YoungMinKim # baekjoon T= int(input()) for i in range(T): a,b = map(int,input().split()) print(a+b) 2020. 9. 5. 이전 1 ··· 14 15 16 17 18 19 20 ··· 36 다음 반응형