RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00647

Kalendar

Unrated 레이팅 미적용
난이도
1s
시간 제한
512MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

Magdalena likes calendars, and she makes her own calendar for each month.
Each day of the month is represented with exactly three characters:
• If the day number is sing\(le-di\)git, then it is represented as ’..X’. For example,
the number 7 is represented as ’..7’.
• If the day number is doub\(le-di\)git, then it is represented as ’.XY’. For example,
the number 17 is represented as ’.17’.
Each row of the calendar represents a week, and each week consists of 7 days. If
the week doesn’t have all the 7 days (because the month doesn’t start on Monday, or it doesn’t end on
Sunday), then the missing days are replaced with ’...’.
Magdalena also wants her calendar to be pretty. She will decorate it in the following way: she will fill
the upper and lower sides with ’-’ (ASCII 45), the left and right sides with ’|’ (ASCII 124), and the
corners with ’+’ (ASCII 43).
For example, the format of Magdalena’s calendar, when the month has 31 days and starts on Wednesday,
is the following:
+–––––––––––––––––––––+
|........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......|
+–––––––––––––––––––––+
Your task is to determine the format of Magdalena’s calendar if it has \(n\) days, and the first day of the
month is the \(x-th\) day of the week. For example, if \(x = 1\), the month starts on Monday, and if \(x = 5\), it
starts on Friday.
Note: We assume the first day of the week is Monday.

제약

Subtask 1 (7 points): All the days will fit in a row.

Subtask 2 (19 points): \(d = 1\)

Subtask 3 (24 points): No additional constraints.

입력 형식

The first and only line contains integers \(n\) and \(d\) (\(1 \le n \le 99\), \(1 \le d \le 7\)), the number of days in the
month, and the day it starts with.

출력 형식

Print Magdalena’s calendar.

서브태스크
서브태스크점수설명

1

7점

All the days will fit in a row.

2

19점

\(d = 1\)

3

24점

No additional constraints.

예제 1
입력
31 3
출력
+---------------------+
|........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......|
+---------------------+
예제 2
입력
1 5
출력
+---------------------+
|..............1......|
+---------------------+
예제 3
입력
28 7
출력
+---------------------+
|....................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...|
+---------------------+
설명

Clarification of the second example:
Note that, although there is only one day in the month, the calendar still has the format of seven days
per row.

문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2022/2023 Contest 5

평가 및 의견

Kalendar

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Kalendar

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8