RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
USACO0635

Job Completion

Diamond IV 다이아몬드 IV
난이도
2s
시간 제한
256MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

Bessie the cow has \(N\) (\(1\le N\le 2\cdot 10^5\)) jobs for you to potentially
complete. The \(i\)-th one, if you choose to complete it, must be started at or
before time \(s_i\) and takes \(t_i\) time to complete
(\(0\le s_i\le 10^{18}, 1\le t_i\le 10^{18}\)).

What is the maximum number of jobs you can complete? Time starts at \(0\), and
once you start a job you must work on it until it is complete, without starting
any other jobs in the meantime.

Problem credits: Benjamin Qi

제약

SCORING

  • Inputs 2: Within the same test case, all \(t_i\) are equal.
  • Inputs 3-4: \(N\le 2000\), \(s_i, t_i\le 2000\)
  • Inputs 5-8: \(N\le 2000\)
  • Inputs 9-16: No additional constraints.

Problem credits: Benjamin Qi

입력 형식

The first line contains \(T\), the number of independent test cases
(\(1\le T\le 10\)). Each test case is formatted as follows.

The first line contains \(N\).

Each of the next \(N\) lines contains two integers \(s_i\) and \(t_i\). Row \(i+1\) has
the details for the \(i\)th job.

It is guaranteed that the sum of \(N\) over all test cases does not exceed
\(3\cdot 10^5\).

출력 형식

For each test case, the maximum number of jobs you can complete, on a new line.

예제 1
입력
3
2
1 4
1 2
2
2 3
1 2
3
1 4
2 3
1 2
출력
1
2
2
설명

For the first test case, you can only complete one of the jobs. After completing
one job, it will then be time \(2\) or later, so it is too late to start the other
job, which must be started at time \(1\) or earlier.

For the second test case, you can start the second job at time \(0\) and finish
at time \(2\), then start the first job at time \(2\) and finish at time \(5\).

문제 정보

riseoj 작성

출처 올림피아드 > USACO > 2024-2025 > December > Gold

태그

평가 및 의견

Job Completion

개요
출제자 난이도 Diamond IV 다이아몬드 IV 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Job Completion

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8