python-algorithm1422 백준 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. codeforces 1669A - Division? 1 2 3 4 5 6 7 8 9 10 11 12 13 def sol(n): if n >= 1900 : print("Division 1") elif n >= 1600 : print('Division 2') elif n >= 1400: print('Division 3') else : print('Division 4') n=int(input()) for _ in range(n): sol(int(input())) 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. codeforces 1619A - Square String? 1 2 3 4 5 6 n=int(input()) for i in range(n): s=input() len_string=len(s) if len_string%2 ==0 and s[:len_string//2]==s[len_string//2:] : print("YES") else : print("NO") Colored by Color Scripter cs 2022. 5. 12. codeforces 1294A - Collecting Coins 1 2 3 4 5 6 7 8 9 10 11 12 13 14 t=int(input()) for i in range(t): nums=list(map(int,input().split())) n=nums[3] nums=nums[:3] threshold=max(nums)*3 ans =n-(threshold-sum(nums)) if ans 2022. 5. 12. codeforces 785A - Anton and Polyhedrons 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 import sys n=int(input()) ans=0 for i in range(n): s=input() if s == 'Tetrahedron': ans += 4 if s == 'Cube': ans += 6 if s == 'Octahedron': ans += 8 if s == 'Dodecahedron': ans += 12 if s == 'Icosahedron': ans += 20 print(ans) cs 2022. 5. 12. leetcode 47. Permutations II 1 2 3 4 5 6 7 8 from itertools import permutations class Solution: def permuteUnique(self, nums: List[int]) -> List[List[int]]: ans=[] for i in permutations(nums) : if list(i) not in ans: ans.append(list(i)) return(ans) Colored by Color Scripter cs 2022. 5. 12. codeforces 1030A - In Search of an Easy Problem 1 2 3 4 5 import sys n=int(input()) nums=list(map(int, sys.stdin.readline().split())) if sum(nums)>0 : print('HARD') else : print('EASY') cs 2022. 5. 11. leetcode 1679. Max Number of K-Sum Pairs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 class Solution: def maxOperations(self, nums: List[int], k: int) -> int: ans=0 nums.sort() start=0 end=len(nums)-1 while end>start : if nums[end] + nums[start] > k : end-=1 elif nums[end] + nums[start] 2022. 5. 4. 이전 1 ··· 42 43 44 45 46 47 48 ··· 119 다음