デンソークリエイトプログラミングコンテスト2026(AtCoder Beginner Contest 443)
翻译中…
Problem Statement
翻译中…
AtCoder Inc. starts work at time $0$ and ends work at time $T$. The interval between time $t$ and time $t+1$ is $1$ second.
Takahashi-kun views the SNS chokutter during AtCoder Inc.'s business hours according to the following rules:
翻译中…
- He opens chokutter at the same time as work starts.
- If chokutter is open at the moment Aoki-kun passes behind Takahashi-kun's desk, he immediately closes it.
- If Takahashi-kun closes chokutter at time
$t$, he always opens it at time$t+100$.
翻译中…
From the start to the end of work, Aoki-kun passed behind Takahashi-kun's desk $N$ times, with the $i$-th time being at time $A_i$.
From the start to the end of work, for how many seconds in total was Takahashi-kun viewing chokutter?
Aoki-kun never passed behind the desk at the moment when Takahashi-kun opened chokutter.
翻译中…
Constraints
翻译中…
- All input values are integers.
$0 \le N \le 3 \times 10^5$$1 \le A_1 < A_2 < \dots < A_N \le T \le 10^9$- Aoki-kun never passes behind the desk at the moment when Takahashi-kun opens chokutter.
翻译中…
Input
翻译中…
The input is given from Standard Input in the following format:
翻译中…
N T
A_1 A_2 \dots A_N
翻译中…
Output
翻译中…
Output the answer.
翻译中…
样例
Input #1
5 700
100 150 300 350 700
Output #1
500
- At time $0$, Takahashi-kun opens chokutter.
- At time $100$, Aoki-kun passes behind Takahashi-kun's desk, and Takahashi-kun immediately closes chokutter.
- At time $150$, Aoki-kun passes behind Takahashi-kun's desk, but Takahashi-kun does not have chokutter open at this time.
- At time $200$, Takahashi-kun opens chokutter again.
- At time $300$, Aoki-kun passes behind Takahashi-kun's desk, and Takahashi-kun immediately closes chokutter.
- At time $350$, Aoki-kun passes behind Takahashi-kun's desk, but Takahashi-kun does not have chokutter open at this time.
- At time $400$, Takahashi-kun opens chokutter again.
- At time $700$, Aoki-kun passes behind Takahashi-kun's desk, and Takahashi-kun immediately closes chokutter.
Takahashi-kun was viewing chokutter for a total of $500$ seconds.
Input #2
0 1000000000
Output #2
1000000000
There may be cases where Aoki-kun never passes behind Takahashi-kun's desk.
Input #3
10 1234
395 424 588 745 773 863 910 958 1102 1195
Output #3
734
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。