Jokes

TimeLimit:2000MS  MemoryLimit:128MB
64-bit integer IO format:%lld
未提交 | 登录后收藏
Problem Description
Mr. Cai loves to tell some jokes to TT. As Mr. Cai don't have too much jokes, he may tell one joke again and again. Fortunately, TT's memory is not that good. That means she can only remember recently M 'new jokes'. Even if she remembered one joke, she won't deepen impression for this joke. Mr. Cai tell one joke per day. And during N days, can you calculate out how many 'new jokes' TT has heard?
Input
This problem contains several cases. The first line of each case is two integers N and M. (1 <= M, N <= 1 000 000) Then follows a line with N integers, each integer is between 0 and 1 000 000.
Output
For each case, you should output the number of 'new jokes' that TT has heard during those days.
SampleInput
9 5
1 2 3 4 5 1 6 1 2
SampleOutput
8
Submit
题目统计信息详细
总AC数83
通过人数68
尝试人数97
总提交量742
AC率9.16%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: