본문 바로가기

728x90
반응형

Study/Algorithm 문제풀이

(32)
[백준] 11047. 동전 0(using python) * 문제의 저작권은 백준에 있습니다. https://www.acmicpc.net/problem/11047 11047번: 동전 0 첫째 줄에 N과 K가 주어진다. (1 ≤ N ≤ 10, 1 ≤ K ≤ 100,000,000) 둘째 줄부터 N개의 줄에 동전의 가치 Ai가 오름차순으로 주어진다. (1 ≤ Ai ≤ 1,000,000, A1 = 1, i ≥ 2인 경우에 Ai는 Ai-1의 배수) www.acmicpc.net 문제 준규가 가지고 있는 동전은 총 N종류이고, 각각의 동전을 매우 많이 가지고 있다. 동전을 적절히 사용해서 그 가치의 합을 K로 만들려고 한다. 이때 필요한 동전 개수의 최솟값을 구하는 프로그램을 작성하시오. 입력 첫째 줄에 N과 K가 주어진다. (1 ≤ N ≤ 10, 1 ≤ K ≤ 100,0..
[python] 단어의 첫번째 모음 기준으로 split 하는 함수 입력 받은 word의 첫 번째 모음 기준으로 split 하는 함수를 만들어 보자 def split(word): vowels = ['a', 'e', 'o', 'i', 'u'] for _ in word: if _ in vowels: return word[:word.index(_)], word[word.index(_):] word = 'goat' word2 = 'sheep' print(word) print(word2) ## 출력 결과 ## ('g', 'oat') ('sh', 'eep') 위와 같이 구현을 하면 소문자로 받은 'goat', 'sheep' 과 같은 단어들은 ('g', 'oat'), ('sh', 'eep') 과 같이 잘 출력이 될 것이다. 하지만, 대문자로 입력을 받는다면 어떻게 될까? word =..
[SW Expert Academy] 1859. 백만 장자 프로젝트(using python) * 문제의 저작권은 SW Expert에 있습니다. swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5LrsUaDxcDFAXc&categoryId=AV5LrsUaDxcDFAXc&categoryType=CODE&problemTitle=%EB%B0%B1%EB%A7%8C&orderBy=FIRST_REG_DATETIME&selectCodeLang=ALL&select-1=&pageSize=10&pageIndex=1 SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com [ 문 제 ] 25년 간의 수행 끝에 원재는 미래를 보는 능력을 갖게 되었다. 이 ..
[SW Expert Academy] 1204. [S/W 문제해결 기본] 1일차 - 최빈수 구하기(using python) * 문제의 저작권은 SW Expert에 있습니다. swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV13zo1KAAACFAYh&categoryId=AV13zo1KAAACFAYh&categoryType=CODE&problemTitle=%5BS%2FW+%EB%AC%B8%EC%A0%9C%ED%95%B4%EA%B2%B0+%EA%B8%B0%EB%B3%B8%5D+1%EC%9D%BC%EC%B0%A8+-+%EC%B5%9C%EB%B9%88%EC%88%98+%EA%B5%AC%ED%95%98%EA%B8%B0&orderBy=FIRST_REG_DATETIME&selectCodeLang=ALL&select-1=&pageSize=10&pageIndex=1..
[SW Expert Academy] 1946. 간단한 압축 풀기(using python) * 문제의 저작권은 SW Expert에 있습니다. swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PmkDKAOMDFAUq&categoryId=AV5PmkDKAOMDFAUq&categoryType=CODE&problemTitle=%EA%B0%84%EB%8B%A8%ED%95%9C&orderBy=FIRST_REG_DATETIME&selectCodeLang=ALL&select-1=&pageSize=10&pageIndex=1 SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com [ 문 제 ] 원본 문서는 너비가 10인 여러 줄의 문자열로 이루어..
[SW Expert Academy] 1948. 날짜 계산기(using python) * 문제의 저작권은 SW Expert에 있습니다. swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PnnU6AOsDFAUq&categoryId=AV5PnnU6AOsDFAUq&categoryType=CODE&problemTitle=%EB%82%A0%EC%A7%9C&orderBy=FIRST_REG_DATETIME&selectCodeLang=ALL&select-1=&pageSize=10&pageIndex=1 SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com [ 문 제 ] 월 일로 이루어진 날짜를 2개 입력 받아, 두 번째 날짜가 첫 번째 ..
[SW Expert Academy] 1976. 시각 덧셈(using python) * 문제의 저작권은 SW Expert에 있습니다. swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PttaaAZIDFAUq&categoryId=AV5PttaaAZIDFAUq&categoryType=CODE&problemTitle=%EC%8B%9C%EA%B0%81&orderBy=FIRST_REG_DATETIME&selectCodeLang=ALL&select-1=&pageSize=10&pageIndex=1 SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com [ 문 제 ] 시 분으로 이루어진 시각을 2개 입력 받아, 더한 값을 시 분으로 출..
[SW Expert Academy] 1983. 조교의 성적 매기기(using python) * 문제의 저작권은 SW Expert에 있습니다. swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PwGK6AcIDFAUq&categoryId=AV5PwGK6AcIDFAUq&categoryType=CODE&problemTitle=%EC%A1%B0%EA%B5%90%EC%9D%98&orderBy=FIRST_REG_DATETIME&selectCodeLang=ALL&select-1=&pageSize=10&pageIndex=1 SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com [ 문 제 ] 학기가 끝나고, 학생들의 점수로 학점을 계산중이다. ..

728x90
반응형