BOJ/백준-24313-Python

cosmos·2023년 3월 16일
0
post-thumbnail

문제

풀이

  • 문제 조건1:모든 n ≥ n0에 대하여
  • 문제 조건2: f(n) ≤ c × g(n)
  • 위 두 문제조건을 고려하고 풀어야한다.

코드

# https://www.acmicpc.net/problem/24313
# boj, 24313: 알고리즘 수업 - 점근적 표기 1, python3
def solve(a1: int, a0: int, c: int, n: int) -> int:
	if c < a1:
    	return 0
    return 1 if a1 * n + a0 <= c * n else 0


if __name__ == '__main__':
    a1, a0 = map(int, input().split())
    c = int(input())
    n = int(input())

    print(solve(a1, a0, c, n))

결과

출처 & 깃허브

boj 24313
github

0개의 댓글