Logo
(追記) (追記ここまで)

30313번 - Idle Terminal 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB84575578.571%

문제

It is migration day at the Big Administration Processing Company: the database containing all administrative documents of all clients needs to be migrated to the latest version of the database software. Quite some things have changed over the past years, and this software has not been upgraded, so the number of migration jobs is high.

The migration jobs run in parallel on the multicore server machine in a first-come-first-serve fashion: every time a core is done running a job, it starts running the first job that has not yet started. The Idle Terminal (IT) Team is sitting huddled around the terminal window, eagerly awaiting the dopamine boost when another migration job completes successfully and a message is printed to the terminal.

The IT Team starts breaking out in sweat when nothing changes on the terminal for quite a long time. Did the connection hang? Has the server soft-locked? Did all jobs get stuck in infinite loops?? On the other hand, some migration jobs really do have a long duration, and it may simply be a coincidence that there are only long-running jobs active at the time. To calm down the IT Team, you decide to compute the longest time that goes by without seeing a new message on the terminal, starting from the moment that the first migration jobs start running.

입력

The input consists of:

  • One line with two integers $n$ and $k$ (1ドル \leq n, k \leq 10^5$), the number of migration jobs and the number of cores in the server machine.
  • One line with $n$ integers $d$ (1ドル \leq d \leq 100$), the duration of each job in the order that they are processed.

출력

제한

예제 입력 1

2 2
3 7

예제 출력 1

4

예제 입력 2

5 10
1 2 3 4 5

예제 출력 2

1

예제 입력 3

4 1
2 10 6 4

예제 출력 3

10

예제 입력 4

6 2
3 5 8 10 4 1

예제 출력 4

6

예제 입력 5

6 3
2 4 6 6 6 6

예제 출력 5

2

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2023 Preliminaries I번

  • 문제를 만든 사람: Ragnar Groot Koerkamp
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /