백준 17091 단어 시계
https://www.acmicpc.net/problem/17091 17091번: 단어 시계 첫째 줄에 시를 나타내는 h(1 ≤ h ≤ 12), 둘째 줄에 분을 나타내는 m(0 ≤ m < 60)이 주어진다. www.acmicpc.net 12345678910111213141516171819202122232425262728293031323334def sol(h, m): hs = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'one'] ms = [" o' clock", "one", "two", "three", "four", "five", "six", "seven"..
2023. 12. 6.
백준 15122 Forbidden Zero
https://www.acmicpc.net/problem/15122 15122번: Forbidden Zero You’re writing the positive integers in increasing order starting from one. But you’ve never learned the digit zero, and thus omit any number that contains a zero in any position. The first ten integers you write are: 1, 2, 3, 4, 5, 6, 7, 8, 9, and 11. www.acmicpc.net 123456789def solution(s): s = str(int(s) + 1) return s.replace('0','..
2023. 11. 28.
백준 16283 Farm
https://www.acmicpc.net/problem/16283 16283번: Farm 입력은 표준입력을 사용한다. 첫 번째 줄에 네 정수 a, b, n, w가 한 줄에 주어진다. 1 ≤ a ≤ 1,000, 1 ≤ b ≤ 1,000, 2 ≤ n ≤ 1,000, 2 ≤ w ≤ 1,000,000이다. www.acmicpc.net 1234567891011121314151617def solution(a, b, n, w): answer = [] for x in range(1, n): if a * x + (n - x) * b == w: answer.append((x, n - x)) if len(answer) == 1: return answer[0] else: return [-1] if __name__ == '_..
2023. 11. 28.