250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- java
- 정올 1620
- 자바 코테
- 전화번호속의암호
- 23288
- 파티션 크기 조정
- 순열
- Bfs와DFS
- N과M
- 알고리즘
- 백준15652
- 볼륨 만들기
- 정보처리기사
- D드라이브생성
- 코테
- 주사위굴리기2
- 중복순열
- 자바
- 삼성역테
- 에라토스테네스의채
- BFS
- 알고리즘개념
- 중복조합
- 백준13458
- 완전탐색
- 백준
- 재귀함수
- 완탐
- 백준2251
- 코테준비
Archives
- Today
- Total
뚱땅뚱땅
[문제] 백준 1476번 날짜 계산 본문
728x90
풀이
public class BOJ_1476 {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(in.readLine(), " ");
int E = Integer.parseInt(st.nextToken());
int S = Integer.parseInt(st.nextToken());
int M = Integer.parseInt(st.nextToken());
int e = 1, s = 1, m = 1;
int year = 1;
while (true) {
if(e == E && s == S && m == M) {
break;
}
year++;
e = (year-1) % 15 + 1;
s = (year-1) % 28 + 1;
m = (year - 1) % 19 + 1;
}
System.out.println(year);
}
}
728x90
'알고리즘 > 백준' 카테고리의 다른 글
[문제] 백준 15686번 치킨 배달 (0) | 2021.02.17 |
---|---|
[문제] 백준 11279번 최대 힙, 1927번 최소 힙 (0) | 2021.02.16 |
[문제] 백준 10972번 다음 순열 (0) | 2021.02.16 |
[문제] 백준 9613번 GCD합 (0) | 2021.02.16 |
[문제] 백준 14503번 로봇 청소기 (0) | 2021.02.15 |
Comments