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

Datum

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

의견: 0

설명

The exam season at University of Zagreb is over and students are doing what
they love the most – sleeping. In the rare moments of wakefulness, they usually
scroll over their Instagram feed. Fabijan is one of those students.
Recently, he read the following caption – the date 02.02.2020. is the first
palindromic date in the last 909 years.
He realized the caption was incorrect and this made him wonder about palindro-
mic dates so he asked himself for each of the \(N\) dates what is the first palindromic date that comes after
that date. The date is considered palindromic if , when disregarding the dots, it is the same when read
from le\(ft-to-ri\)ght as if it was read from rig\(ht-to-le\)ft. For example, dates 02.02.2020. and 12.10.0121.
are palindromic, while 03.02.2020. and 12.07.1993. are not.
Note: In this task it is important to take account of leap years which have 29 days in February. For the
purposes of this task, we consider a year to be a leap year if it is divisible by 4. Otherwise, months have
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30 and 31 days in order.

제약

In the test cases worth a total of 10 points, each date in the output will have the same month and year as
the corresponding date from the input. Also, \(N\) will be equal to 10.
In the test cases worth an additional 10 points, each date in the output will have the same year as the
corresponding date from the input. Also, \(N\) will be equal to 10.
In the test cases worth an additional 20 points, \(N = 10\) will hold.

입력 형식

The first line contains an integer \(N\) (\(1 \le N \le 10\,000\)) from the task description.
The next \(N\) lines contain a valid date in format DD.MM.YYYY.

출력 형식

For each date from the input, you should output the first palindromic date that comes strictly after it.
That date should be printed in the DD.MM.YYYY. and we guarantee that the solution exists in this format.

예제 1
입력
1
02.02.2020.
출력
12.02.2021.
예제 2
입력
2
01.01.1000.
31.12.2026.
출력
10.01.1001.
03.02.2030.
예제 3
입력
3
01.01.0100.
05.07.0321.
05.05.0505.
출력
10.10.0101.
10.01.1001.
10.01.1001.
설명

Clarification of the first example: Although the given date is palindromic, Fabijan is interested in
the first date that strictly comes after it. That date is 12.02.2021.

문제 정보

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

출처 COCI 2019/2020 Contest 6

평가 및 의견

Datum

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

Log in to rate problems.

개별 의견

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

풀이 제출

Datum

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