포럼
문제 ICPC00336

I. Implementation Irregularities

설명

Impressed by the performance of the top teams at the recent BAPC preliminaries, you started to wonder whether teams were allowed to use one or multiple computers to implement their solutions.

Instead of unnecessarily bothering the organization with more questions, you will figure this out by yourself. Being a jury member, you already have estimates for the computer time required to solve each problem.

Using this information, and the time in the contest at which the top team solved each of their solved problems, compute the minimal number of computers used by the team.

The team may work on multiple problems before getting any one of them accepted. Furthermore, the contestants are great multitaskers and can work on a single problem using multiple computers at the same time, but each computer can only be used for one problem at a time.

제약
입력 형식

The input consists of:
- One line containing an integer \(n\) (\(1\leq n\leq 10^5\)), the number of problems in the contest.
- One line containing \(n\) integers \(t_1, t_2, \dots, t_n\) (\(1\leq t_i \leq 10^4\)), the computer time required to solve problem \(i\).
- One line containing \(n\) integers \(s_1, s_2, \dots, s_n\) (\(1\leq s_i \leq 10^9\) or \(s_i = -1\)), the time at which problem \(i\) was solved, or \(-1\) if it was not solved.

It is guaranteed that the team solved at least one problem.

출력 형식

Output the minimum number of computers used by the team.

예제 1
입력
11
50 8 10 6 300 5 6 3 18 5 12
117 23 63 6 -1 48 80 42 37 13 131
출력
1
예제 2
입력
1
10
3
출력
4
예제 3
입력
2
2 4
3 3
출력
2
예제 4
입력
2
4 6
10 10
출력
1
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC BAPC 2021

평가 및 의견

I. Implementation Irregularities

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

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

풀이 제출

I. Implementation Irregularities

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