목록수학 (13)
꾸준히 합시다
https://www.acmicpc.net/problem/5101 5101번: Sequences 11 is the 5th term The sequence is –1, -4, -7, -10 (-1+ -3 = -4, -4 + –3 = -7, -7+ -3 = -10) -8 isn’t in the sequence. www.acmicpc.net 문제 유형: 수학 # Solution 1 while True: start, dif, target = map(int, input().split()) if start == dif == target == 0: break if ((dif > 0 and target = start)): print('X') elif (target - start) % dif == 0: print((ta..
https://www.acmicpc.net/problem/3486 3486번: Adding Reversed Numbers The Antique Comedians of Malidinesia prefer comedies to tragedies. Unfortunately, most of the ancient plays are tragedies. Therefore the dramatic advisor of ACM has decided to transfigure some tragedies into comedies. Obviously, this work is very hard beca www.acmicpc.net 문제 유형: 수학, 구현, 사칙연산 # Solution 1 import sys input = sys.s..
https://www.acmicpc.net/problem/4714 4714번: Lunacy After several months struggling with a diet, Jack has become obsessed with the idea of weighing less. In an odd way, he finds it very comforting to think that, if he had simply had the luck to be born on a different planet, his weight could be considerably www.acmicpc.net 문제 유형: 수학, 사칙연산 # Solution 1 while True: weight = float(input()) if weight..
www.acmicpc.net/problem/9506 9506번: 약수들의 합 어떤 숫자 n이 자신을 제외한 모든 약수들의 합과 같으면, 그 수를 완전수라고 한다. 예를 들어 6은 6 = 1 + 2 + 3 으로 완전수이다. n이 완전수인지 아닌지 판단해주는 프로그램을 작성하라. www.acmicpc.net 문제 유형: 수학, 정수론 # Solution 1 while True: n = int(input()) if n == -1: # 입력 값이 -1이면 반복문 종료 break; arr = [] for i in range(1, n): if n % i == 0: arr.append(i) if sum(arr) == n: print(n, " = ", " + ".join(str(i) for i in arr), sep=..