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

23950번 - H-index 서브태스크다국어

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

문제

It is important for researchers to write many high quality academic papers. Jorge has recently discovered a way to measure how impactful a researcher's papers are: the H-index.

The H-index score of a researcher is the largest integer h such that the researcher has h papers with at least h citations each.

Jorge has written N papers in his lifetime. The i-th paper has Ai citations. The number of citations that each paper has will never change after it is written. Please help Jorge determine his H-index score after each paper he wrote.

입력

The first line of the input gives the number of test cases, T. T test cases follow. Each test case begins with a line containing N, the number of papers Jorge wrote.

The second line contains N integers. The i-th integer is Ai, the number of citations the i-th paper has.

출력

For each test case, output one line containing Case #x: y, where x is the test case number (starting from 1) and y is a space-separated list of integers. The i-th integer is the H-index score after Jorge wrote his i-th paper.

제한

  • 1 ≤ T ≤ 100.
  • 1 ≤ Ai ≤ 105.

Test Set 1 (5점)

  • 1 ≤ N ≤ 1000.

Test Set 2 (16점)

  • 1 ≤ N ≤ 105.

예제 입력 1

2
3
5 1 2
6
1 3 3 2 2 15

예제 출력 1

Case #1: 1 1 2
Case #2: 1 1 2 2 2 3

힌트

In Sample Case #1, Jorge wrote N = 3 papers.

  • After the 1st paper, Jorge's H-index score is 1, since he has 1 paper with at least 1 citation.
  • After the 2nd paper, Jorge's H-index score is still 1.
  • After the 3rd paper, Jorge's H-index score is 2, since he has 2 papers with at least 2 citations (the 1st and 3rd papers).

In Sample Case #2, Jorge wrote N = 6 papers.

  • After the 1st paper, Jorge's H-index score is 1, since he has 1 paper with at least 1 citation.
  • After the 2nd paper, Jorge's H-index score is still 1.
  • After the 3rd paper, Jorge's H-index score is 2, since he has 2 papers with at least 2 citations (the 2nd and 3rd papers).
  • After the 4th paper, Jorge's H-index score is still 2.
  • After the 5th paper, Jorge's H-index score is still 2.
  • After the 6th paper, Jorge's H-index score is 3, since he has 3 papers with at least 3 citations (the 2nd, 3rd and 6th papers).

출처

Contest > Google > Kick Start > Google Kick Start 2019 > Round H A번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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