본문 바로가기

백준1064

백준 24883 자동완성 1 2 3 4 5 6 def sol(s): if s=='N' or s=='n' : print('Naver D2') else : print('Naver Whale') sol(input()) cs 2022. 5. 25.
백준 24723 녹색거탑 1 2 3 4 def sol(n): return pow(2,n) print(sol(int(input()))) cs 2022. 5. 25.
백준 24309 РАВЕНСТВО 1 2 3 4 5 6 7 def sol(a,b,c): return (b-c)//a a=int(input()) b=int(input()) c=int(input()) print(sol(a,b,c)) cs 2022. 5. 24.
백준 24568 Cupcake Party 1 2 3 4 5 6 def cnt(regular, small): return regular*8+small*3-28 regular=int(input()) small=int(input()) print(cnt(regular,small)) cs 2022. 5. 24.
백준 24736 Football Scoring 1 2 3 4 5 def cnt(nums): return nums[0]*6+nums[1]*3+nums[2]*2+nums[3]*1+nums[4]*2 nums1=list(map(int, input().split())) nums2=list(map(int, input().split())) print(cnt(nums1),cnt(nums2)) Colored by Color Scripter cs 2022. 5. 24.
백준 10995 별 찍기 - 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 def odd_line(n): for i in range(1,2*n): if i%2==1 : print('*',end='') else : print(' ',end='') def even_line(n): for i in range(1,2*(n+1)): if i%2==1 : print(' ',end='') else : print('*',end='') n=int(input()) for i in range(1,n+1): if i%2==1 : odd_line(n) else : even_line(n) print() cs 2022. 5. 16.
백준 9012 괄호 1 2 3 4 5 6 7 n=int(input()) for i in range(n) : s=input() for j in range(50) : s=s.replace('()','') if s=='': print('YES') else : print('NO') cs Line 4에서 범위를 50으로 지정한 이유는 문자열의 길이가 최대 50이라 정말 최악의 상황을 가정해서 50을 넣었고 시간복잡도는 최악일때 O(N*50)≒O(N)이 되겠습니다 2022. 4. 22.
백준 24510 시간복잡도를 배운 도도 1 2 3 4 5 6 mymax=0 for i in range(int(input())): s=input() cnt=s.count('for')+s.count('while') mymax=max(cnt,mymax) print(mymax) cs 2022. 4. 21.
백준 25024 시간과 날짜 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 def sol1(a,b): if (a>=0 and a=0 and b=1 and b=1 and b= 1 and b 2022. 4. 21.
백준 24079 移動 (Moving) 1 2 3 4 5 x=int(input()) y=int(input()) z=int(input()) if x+y>z : print(0) else : print(1) cs 2022. 4. 12.
백준 알고리즘 수업 - 알고리즘의 수행 시간 1 1 2 print(1) print(0) cs 이 로직은 입력값에 따라 변하는게 없네요 2022. 4. 12.
백준 2139 나는 너가 살아온 날을 알고 있다 1 2 3 4 5 6 7 8 9 from datetime import date def numOfDays(date1, date2): return (date2 - date1).days while 1: d,m,y=map(int, input().split()) if d==0 and m==0 and y==0 :break date1 = date(y, 1, 1) date2 = date(y, m, d) print(numOfDays(date1, date2)+1) cs 2022. 3. 15.