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

16692번 - Greedy Scheduler 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 512 MB (추가 메모리 없음)20315212675.449%

문제

A store has n cashiers numbered sequentially from 1 to n, with c customers in a queue. A customer at the front of the queue is constantly assigned to the first unoccupied cashier, i.e., cashier with the smallest number. The ith customer’s shopping cart takes ti seconds to process.

Find which cashier will process each customer’s shopping cart.

입력

The first line of input contains two space-separated integers n and c (1 ≤ n ≤ c ≤ 1000). The second line of input contains c space-separated integers t1, . . . , tc (1 ≤ ti ≤ 1,000), representing the length of time required to handle that customer.

출력

Output a single line containing c space-separated integers, each with the cashier number that handles that customer.

제한

예제 입력 1

3 10
406 424 87 888 871 915 516 81 275 578

예제 출력 1

1 2 3 3 1 2 3 1 2 1

힌트

출처

ICPC > Regionals > North America > Pacific Northwest Regional > 2018 Pacific Northwest Region Programming Contest > Division 2 S번

  • 빠진 조건을 찾은 사람: orihehe
(追記) (追記ここまで)

출처

대학교 대회

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

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