목록분류 전체보기 (317)
지나가던 개발자

N = int(input()) groups = [] for i in range(N): word = sorted(list(input())) if word not in groups: groups.append(word) print(len(groups))

input() [print(x, end=" ") for x in sorted(list(map(int, input().split()))+list(map(int, input().split())))]

N = int(input()) dots = [] for i in range(N): dots.append(list(reversed(list(map(int, input().split()))))) for i in sorted(dots): print(i[1], i[0])
저번에 백준의 11723번 문제를 이 비트마스킹을 사용해서 풀었었습니다. https://developer-next-to-you.tistory.com/295 [Python] 백준 11723번(집합) 문제 풀이 import sys S = 0 for i in range(int(sys.stdin.readline())): command = sys.stdin.readline().split() if len(command) == 1: if command[0] == "all": S = (1 developer-next-to-you.tistory.com 비트마스킹이란 기본적으로 정말 간단한 개념입니다. 컴퓨터는 이진수로 생각하죠? 이진수는 0과 1로 이루어져 있습니다. 이 0과 1을 각각 False와 True로 생각하여 연..

import sys S = 0 for i in range(int(sys.stdin.readline())): command = sys.stdin.readline().split() if len(command) == 1: if command[0] == "all": S = (1

n = int(input()) print('어느 한 컴퓨터공학과 학생이 유명한 교수님을 찾아가 물었다.') for i in range(n): print("_"*(i*4)+'"재귀함수가 뭔가요?"') print("_"*(i*4)+'"잘 들어보게. 옛날옛날 한 산 꼭대기에 이세상 모든 지식을 통달한 선인이 있었어.') print("_"*(i*4)+'마을 사람들은 모두 그 선인에게 수많은 질문을 했고, 모두 지혜롭게 대답해 주었지.') print("_"*(i*4)+'그의 답은 대부분 옳았다고 하네. 그런데 어느 날, 그 선인에게 한 선비가 찾아와서 물었어."') print("_"*(n*4)+'"재귀함수가 뭔가요?"') print("_"*(n*4)+'"재귀함수는 자기 자신을 호출하는 함수라네"') for i i..

n = int(input()) people = [] for i in range(n): people.append(list(map(int, input().split()))) for i in people: ranking = 1 for j in people: if i[0] < j[0] and i[1] < j[1]: ranking += 1 print(ranking, end=" ")

import sys for i in range(int(sys.stdin.readline())): n = int(sys.stdin.readline()) if n == 0: print("Case #"+str(i+1)+": INSOMNIA") continue j = 1 s = [] while True: for k in set(str(n*j)): if int(k) not in s: s.append(int(k)) if 0 in s and 1 in s and 2 in s and 3 in s and 4 in s and 5 in s and 6 in s and 7 in s and 8 in s and 9 in s: print("Case #"+str(i+1)+": "+str(n*j)) break j += 1