일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 27 | 28 | 29 | 30 |
31 |
- IntelliJ
- 데이터베이스
- 프로그래머스
- 코테
- 이펙티브자바
- 알고리즘
- 탐욕법
- join
- 깊이우선탐색
- DFS
- SQL
- java
- springboot
- mybatis
- 다이나믹프로그래밍
- Effective Java
- BFS
- db
- 피보나치
- mariaDB
- Spring
- 우선순위큐
- select
- 너비우선탐색
- 그리디알고리즘
- 정렬
- 백준
- DP
- Database
- Greedy
- Today
- Total
목록java (150)
땀두 블로그

이 문제는 https://ddamdoo.tistory.com/106 이 문제에서 x좌표와 y좌표만 변경된 문제이다. 따라서 compare함수 내부 조건만 변경해주면 쉽게 해결이 가능하다. import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Comparator; import java.util.StringTokenizer; public class p11651 { public static void main(String[] args) throws IOException { // TODO Auto-generated method ..

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Comparator; import java.util.StringTokenizer; public class p11650 { public static void main(String[] args) throws IOException { // TODO Auto-generated method stub BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; String..

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; import java.util.Comparator; public class p10814 { public static void main(String[] args) throws IOException { // TODO Auto-generated method stub BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; String..

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class p1978 { public static void main(String[] args) throws IOException { // TODO Auto-generated method stub BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; int cnt = 0; int rst = 0; int a = Integer.parseInt(br.readLin..

import java.util.Scanner; public class p2609 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = a * b; while (b != 0) { int r = a % b; a = b; b = r; } System.out.println(a); System.out.println(c/a); } } 모듈러 연산을 통해서 간단하게 최대공약수를 구한 뒤 a, b의 곱에서 최소공배수를 나누어주어 최소공배수를 구한다.