algorithm/문제 풀이 34

백준 1271번 (엄청난 부자2) 자바 Java11

문제 : 엄청난 부자2 시간 제한 : 2 sec 메모리 제한 : 128 MB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import java.util.*; import java.math.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String str = scan.nextLine(); String[] temp = str.split(" "); BigInteger m = new BigInteger(temp[0]); BigInteger n = new BigInteger(temp[1]); System.out.println(m.divide(n)); Syst..

백준 2609번 (최대공약수와 최소공배수) 자바 Java11

문제 : 최대공약수와 최소공배수 시간 제한 : 1 sec 메모리 제한 : 128 MB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a,b; a = sc.nextInt(); b = sc.nextInt(); int result = getResult(a,b); System.out.println(result); System.out.println(getResult2(a,b,result)); } public static i..