본문 바로가기

백준1056

백준 3183 Dates 1 2 3 4 5 6 7 8 import datetime while 1: d,m,y=map(int,input().split()) if d==0 and m==0 and y==0 :break try: datetime.date(y,m,d) print("Valid") except : print("Invalid") cs 2022. 1. 19.
백준 2948 2009년 1 2 3 4 import datetime days=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"] d,m=map(int,input().split()) print(days[(datetime.date(2009,m,d)).weekday()]) cs 2022. 1. 19.
백준 16199 나이 계산하기 1 2 3 4 5 6 7 8 9 10 11 12 birthYear,birthMonth,birthDay=map(int,input().split()) currentYear, currentMonth, currentDay = map(int, input().split()) if currentMonth>birthMonth : ageFirst=currentYear-birthYear elif currentMonth=birthDay : ageFirst= currentYear-birthYear else: ageFirst=currentYear-birthYear-1 ageSecond= currentYear-birthYear +1 ageThird=currentYear-birthYear print(ageFirst) print(a.. 2022. 1. 14.
백준 15651 N과 M (3) 1 2 3 4 5 6 7 8 9 10 11 12 n,m=map(int,input().split()) s=[] def dfs(): if len(s)==m: tmp=(" ".join(map(str, s))) print(tmp) return for i in range(1,n+1): s.append(i) dfs() s.pop() dfs() cs 2022. 1. 10.
백준 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.