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

Titlovi

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

의견: 0

설명

1 \(s / 64\) \(MB / 50\) points

In order to understand speech in foreign films, the translation of the spoken text is displayed at the

bottom of the screen, colloquially called subtitles. In the digital world, subtitles are often written in

.SRT files that consist of blocks of the following format:

[Ordinal number of the block]
[Beginning time of the subtitles → Ending time of the subtitles]
[Subtitle text in one or more lines]

These blocks are separated by one blank line. The time is in the form of HH:MM:SS,TTT (note the

colon and the comma), meaning hour:minute:second,millisecond . One second contains 1000

milliseconds. Here's an example of a .SRT file:

1
00:00:01,600 → 00:00:04,200
Good day!

2
00:00:05,900 → 00:00:07,999
Good day to you too!
Here you go!

3
00:00:10,000 → 00:00:14,000
May I please have ten garlic sausages?

Sometimes subtitles are not fully synchronized with the associated movie, and appear for example

two seconds too soon or too late. Because of that we want all the times in the appropriate .SRT file,

or in some part of that file, to shift forward or backward for a specified number of (milli)seconds. Write

a program which does that.

제약
입력 형식

Input data contains up to 30 lines that represent part of some .SRT file.
The first line begins with a block with the ordinal number \(X\) , followed by blocks with ordinal numbers

\(X\) + 1, \(X\) + 2, ..., \(X\) + \(K\) , in the form described in the task statement.
Blocks are separated by a single blank line. The subtitles text within the block contains one or more

n\(on-em\)pty lines containing the letters of the english alphabet and the punctuation marks ',.?! .
The line after the last block contains only the '#' sign that indicates the end of the observed part of the

file and that character will not appear elsewhere.
The following (last) line contains the time in milliseconds (-10 000 ≤ \(T \le 10\,000\)), which needs to be

added to all subtitle blocks.

출력 형식

Print part of the .SRT file given in the input data, whereby the time stamps (beginning and ending

time of each block) should be increased by T milliseconds. Test samples will ensure that the required

time stamps are not negative.

1 \(s / 64\) \(MB / 50\) points

예제 1
입력
8
00:00:01,600 --> 00:00:04,200
We thought you was...

9
00:00:05,900 --> 00:00:07,999
a toad.
#
300

624
00:43:30,566 --> 00:43:32,108
Howdy do, ladies?

625
00:43:32,276 --> 00:43:33,943
Name of Pete.

626
00:43:47,124 --> 00:43:48,082
Ain't you gonna
introduce us, Pete?
#
-500
출력
output
8
00:00:01,900 --> 00:00:04,500
We thought you was...

9
00:00:06,200 --> 00:00:08,299
a toad.
#

624
00:43:30,066 --> 00:43:31,608
Howdy do, ladies?

625
00:43:31,776 --> 00:43:33,443
Name of Pete.

626
00:43:46,624 --> 00:43:47,582
Ain't you gonna
introduce us, Pete?
#
문제 정보

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

출처 COCI 2018/2019 Contest 5

평가 및 의견

Titlovi

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

Log in to rate problems.

개별 의견

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

풀이 제출

Titlovi

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