본문 바로가기

백준 문제풀기/JAVA

[백준 24313 JAVA 자바] 알고리즘 수업 - 점근적 표기 1

 

코드입니다

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

interface Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        
        StringTokenizer st;

        String[] arr = br.readLine().split(" ");
        int a1 = Integer.parseInt(arr[0]), a0 = Integer.parseInt(arr[1]);
        int c = Integer.parseInt(br.readLine());
        int n0 = Integer.parseInt(br.readLine());

        int result = ((a1*n0 + a0 <= c*n0) && (c >= a1)) ? 1: 0;
        
        System.out.println(result);
    }
}