본문 바로가기

백준1064

백준 15650 N과 M (2) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 n,m=map(int,input().split()) s=[] ans=[] def dfs(): if len(s)==m: tmpAns=sorted((map(int,s))) if tmpAns not in ans :ans.append(tmpAns) return for i in range(1, n+1): if i not in s: s.append(i) dfs() s.pop() dfs() for i in ans: print(*i) Colored by Color Scripter cs 2022. 1. 10.
백준 15649 N과 M (1) 1 2 3 4 5 from itertools import permutations n,m =map(int,input().split()) p=permutations(range(1,n+1),m) for i in p: print(" ".join(map(str,i))) cs 2022. 1. 10.
백준 13610 Volta 1 2 3 4 5 6 x,y=map(int,input().split()) for i in range(1, 10**10): cmpX,cmpY=i/x,i/y if cmpX>=1+cmpY: if (i%x) ==0 :print(i//x) ;break else : print(i//x+1) ; break cs 2022. 1. 10.
백준 14065 Gorivo 1 2 3 x = float(input()) ans = 1000*100 / ((1609.344 / 3.785411784) * x) print("%.6f" % ans) cs 2022. 1. 10.
백준 14173 Square Pasture 1 2 3 4 5 6 x1,y1,x2,y2=map(int,input().split()) x3,y3,x4,y4=map(int,input().split()) xMax,xMin=max(x1,x2,x3,x4),min(x1,x2,x3,x4) yMax,yMin=max(y1,y2,y3,y4),min(y1,y2,y3,y4) sqaure=max(xMax-xMin,yMax-yMin) print(sqaure**2) cs 2022. 1. 10.
백준 24083 短針 (Hour Hand) 1 2 3 4 start=int(input())+int(input()) while start >12 : start-=12 print(start) cs 2022. 1. 10.
백준 8674 Tabliczka 1 2 3 a,b=map(int, input().split()) if a%2==1 and b%2==1: print(min(a,b)) else: print (0) cs 2022. 1. 9.
백준 6810 ISBN 1 2 3 4 5 6 7 8 n='9780921418' for _ in range(3): n+=input() returnSum=0 for i in range(len(n)): if i%2==0: returnSum+=int(n[i])*1 else: returnSum+=int(n[i])*3 print("The 1-3-sum is %d"%returnSum) cs ISBN의 홀수자리숫자에 1을 곱해서 합한 값과 짝수자리의 숫자에 3을 곱해서 합한 값이 10으로 나눠진다네요 2022. 1. 9.
백준 3004 체스판 조각 1 2 3 4 n=int(input()) if n%2==0: a1,a2=n//2,n//2 else : a1,a2=n//2+1,n//2 print((a1+1)*(a2+1) ) cs 2022. 1. 9.
백준 24086 身長 (Height) 1 print( abs(int(input())-int(input()))) cs 2022. 1. 9.
백준 24082 立方体 (Cube) 1 print(int(input())**3) cs 2022. 1. 9.
백준 24078 余り (Remainder) 1 print(int(input())%21) cs 2022. 1. 9.