728x90
풀이
현재 일요일 날짜 n과 2주 전의 일요일 날짜 m이 주어질 때
1주일 전의 일요일 날짜를 구하면 되는 문제다.
n이 충분히 크면(8 이상) n에서 7을 빼고, 충분하지 않으면 m에 7일을 더한 결과가 정답이다.
소스코드
출처
27182번: Rain Diary
Petya lives in Saint Petersburg and he is keen on meteorology. It is widely believed that it constantly rains in Saint Petersburg. Petya has decided to statistically prove or disprove this statement. For this Petya started a rain diary and every week at Su
www.acmicpc.net
728x90
'PS > Baekjoon Online Judge' 카테고리의 다른 글
[백준 9782] Median [Python] (0) | 2023.04.12 |
---|---|
[백준 27110] 특식 배부 [Python] (0) | 2023.04.12 |
[백준 1389] 케빈 베이컨의 6단계 법칙 [Python] (0) | 2023.04.08 |
[백준 27213] Граничные клетки [Python] (0) | 2023.04.07 |
[백준 2422] 한윤정이 이탈리아에 가서 아이스크림을 사먹는데 [C] (0) | 2023.04.06 |