본문 바로가기

Codeup 1272 - 기부 http://codeup.kr/problem.php?id=1272 Codeup 1272 - 기부 k, h = map(int, input().split())sumMoney = 0​​def getCurrentMoney(n): currentMoney = 0 for i in range(1, n+1): if i % 2 == 0: currentMoney = int(i / 2) * 10 else: currentMoney = int(i / 2) + 1 return currentMoney​​sumMoney += getCurrentMoney(k)sumMoney += getCurrentMoney(h)​print(sumMoney)
Codeup 1271 - 최대값 구하기 http://codeup.kr/problem.php?id=1271 Codeup 1271 - 최대값 구하기 n = input()numbers = list(map(int, input().split()))maximum_number = 0​for number in numbers: if(number > maximum_number): maximum_number = number​print(maximum_number)
Codeup 1270 - 1의 개수는 1 http://codeup.kr/problem.php?id=1270 Codeup 1270 - 1의 개수는? 1 n = int(input())count = 0​for i in range(1, n+1): if(i % 10 == 1): count += 1​print(count)
Codeup 1269 - 수열의 값 구하기 http://codeup.kr/problem.php?id=1269 Codeup 1269 - 수열의 값 구하기 a, b, c, n = input().split()a = int(a)b = int(b)c = int(c)n = int(n)number = a​for i in range(0, n-1): number = number * b + c​print(number)
Codeup 1268 - n개의 수 중 짝수의 개수 http://codeup.kr/problem.php?id=1268 Codeup 1268 - n개의 수 중 짝수의 개수 n = int(input())numbers = list(map(int, input().split()))count_even = 0​for number in numbers: if number % 2 == 0: count_even += 1​print(count_even)
Codeup 1267 - n개의 수 중 5의 배수의 합 http://codeup.kr/problem.php?id=1267 Codeup 1267 - n개의 수 중 5의 배수의 합 length = int(input())numbers = list(map(int, input().split()))result = 0​for number in numbers: if number % 5 == 0: result += number​print(result)
HackerRank - Cats and a Mouse https://www.hackerrank.com/challenges/cats-and-a-mouse/problem HackerRank - Cats and a Mouse #!/bin/python3​import mathimport osimport randomimport reimport sys​​def catAndMouse(x, y, z): catA = x - z catB = y - z output = ''​ if(catA
HackerRank - Electronics Shop https://www.hackerrank.com/challenges/electronics-shop/problem HackerRank - Electronics Shop ​x#!/bin/python3​import osimport sys​​def getMoneySpent(keyboards, drives, b): spent = -1 for keyboard in keyboards: for drive in drives: if keyboard + drive