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

True or False Test

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

의견: 0

설명

*Note: The time limit for this problem is 3s, 1.5x the default. The memory
limit for this problem is 512MB, twice the default.
*

Bessie is taking an \(N\)-question true or false test (\(1\le N\le 2\cdot 10^5\)).
For the \(i\)-th question, she will gain \(a_i\) points if she gets it correct, lose
\(b_i\) points if she gets it incorrect, or remain even if she does not answer it
(\(0).

Bessie knows all the answers because she is a smart cow, but worries that Elsie
(who is administering the test) will retroactively change up to \(k\) of the
questions after the test such that Bessie does not get those questions correct.

Given \(Q\) (\(1\le Q\le N+1\)) candidate values of \(k\) (\(0\le k\le N\)), determine
the number of points Bessie can guarantee for each \(k\), given that she must
answer at least \(k\) questions.

Problem credits: Benjamin Qi

제약

SCORING

  • Inputs 2-4: \(N\le 100\)
  • Inputs 5-7: \(Q\le 10\), \(N\le 2\cdot 10^5\)
  • Inputs 7-20: No additional constraints.

Problem credits: Benjamin Qi

입력 형식

The first line contains \(N\) and \(Q\).

The next \(N\) lines each contain \(a_i\) and \(b_i\).

The next \(Q\) lines each contain a value of \(k\). No value of \(k\) appears more
than once.

출력 형식

The answer for each \(k\) on a separate line.

예제 1
입력
2 3
3 1
4 2
2
1
0
출력
-3
1
7
설명

For each value of \(k\), it is optimal for Bessie to answer all of the questions.

문제 정보

riseoj 작성

출처 올림피아드 > USACO > 2024-2025 > February > Platinum

태그

평가 및 의견

True or False Test

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

Log in to rate problems.

개별 의견

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

풀이 제출

True or False Test

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