728x90
반응형
https://www.acmicpc.net/problem/1476
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int E = sc.nextInt();
int S = sc.nextInt();
int M = sc.nextInt();
int i = 1;
while (true) {
if (((i - E) % 15 == 0) && ((i - S) % 28 == 0) && ((i - M) % 19 == 0)) {
System.out.println(i);
break;
}
i++;
}
}
}
|
cs |
728x90
반응형
'알고리즘 > 완전탐색' 카테고리의 다른 글
[C++ 백준] 실버 5/1436번 영화감독 숌 (0) | 2022.02.21 |
---|---|
[java 백준] 골드 1/ 2098번 외판원 순회 2 (0) | 2022.02.20 |
[java 백준] 골드 5/1451번 직사각형으로 나누기 (0) | 2022.02.17 |
[java 백준] 골드 5/1107번 리모컨 (0) | 2022.02.13 |
[C++백준] 실버 2/ 10819번 차이를 최대로 (0) | 2022.02.09 |
댓글