본문 바로가기
반응형

Bronze148

[백준/Python] Bronze I #9506 약수들의 합 9506번: 약수들의 합 어떤 숫자 n이 자신을 제외한 모든 약수들의 합과 같으면, 그 수를 완전수라고 한다. 예를 들어 6은 6 = 1 + 2 + 3 으로 완전수이다. n이 완전수인지 아닌지 판단해주는 프로그램을 작성하라. www.acmicpc.net 문제 어떤 숫자 n이 자신을 제외한 모든 약수들의 합과 같으면, 그 수를 완전수라고 한다. 예를 들어 6은 6 = 1 + 2 + 3 으로 완전수이다. n이 완전수인지 아닌지 판단해주는 프로그램을 작성하라. 입력 입력은 테스트 케이스마다 한 줄 간격으로 n이 주어진다. (2 < n < 100,000) 입력의 마지막엔 -1이 주어진다. 출력 테스트케이스 마다 한줄에 하나씩 출력해야 한다. n이 완전수라면, n을 n이 아닌 약수들의 합으로 나타내어 출력한다(예.. 2023. 8. 22.
[백준/Python] Bronze V #22193 Multiply 22193번: Multiply Write a program that computes a product of two non-negative integers A and B. The integers are represented in decimal notation and have N and M digits, respectively. www.acmicpc.net 문제 Write a program that computes a product of two non-negative integers A and B. The integers are represented in decimal notation and have N and M digits, respectively. 입력 The first line contains the.. 2023. 8. 19.
[백준/Python] Bronze V #27434 팩토리얼 3 27434번: 팩토리얼 3 0보다 크거나 같은 정수 N이 주어진다. 이때, N!을 출력하는 프로그램을 작성하시오. www.acmicpc.net 문제 0보다 크거나 같은 정수 N이 주어진다. 이때, N!을 출력하는 프로그램을 작성하시오. 입력 첫째 줄에 정수 N(0 ≤ N ≤ 100,000)이 주어진다. 출력 첫째 줄에 N!을 출력한다. 풀이 from math import factorial n = int(input()) print(factorial(n)) pypy3로 제출하면 된다 2023. 8. 19.
[백준/Python] Bronze V #21300 Bottle Return 21300번: Bottle Return In the United States, beverage container deposit laws, or so-called bottle bills, are designed to reduce litter and reclaim bottles, cans and other containers for recycling. Ten states currently have some sort of deposit-refund systems in place for differe www.acmicpc.net 문제 In the United States, beverage container deposit laws, or so-called bottle bills, are designed to re.. 2023. 8. 18.
[백준/Python] Bronze V #20254 Site Score 20254번: Site Score Teams from variaous universities compete in ICPC regional contests for tickets to the ICPC World Finals. The number of tickets allocated to every regional contest may be different. The allocation method in our super region, Asia Pacific, is based on a para www.acmicpc.net 문제 Teams from variaous universities compete in ICPC regional contests for tickets to the ICPC World Finals.. 2023. 8. 18.
반응형