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

Equal Sum Subarrays

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

의견: 0

설명

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

FJ gave Bessie an array \(a\) of length \(N\)
(\(2\le N\le 500, -10^{15}\le a_i\le 10^{15}\)) with all \(\frac{N(N+1)}{2}\)
contiguous subarray sums distinct. For each index \(i\in [1,N]\), help Bessie
compute the minimum amount it suffices to change \(a_i\) by so that there are two
different contiguous subarrays of \(a\) with equal sum.

Problem credits: Benjamin Qi

제약

SCORING

  • Input 3: \(N\le 40\)
  • Input 4: \(N \le 80\)
  • Inputs 5-7: \(N \le 200\)
  • Inputs 8-16: No additional constraints.

Problem credits: Benjamin Qi

입력 형식

The first line contains \(N\).

The next line contains \(a_1,\dots, a_N\) (the elements of \(a\), in order).

출력 형식

One line for each index \(i\in [1,N]\).

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

Decreasing \(a_1\) by \(2\) would result in \(a_1+a_2=a_2\). Similarly, increasing
\(a_2\) by \(3\) would result in \(a_1+a_2=a_1\).

예제 2
입력
3
3 -10 4
출력
1
6
1
설명

Increasing \(a_1\) or decreasing \(a_3\) by \(1\) would result in \(a_1=a_3\).
Increasing \(a_2\) by \(6\) would result in \(a_1=a_1+a_2+a_3\).

문제 정보

riseoj 작성

출처 올림피아드 > USACO > 2022-2023 > February > Gold

태그

평가 및 의견

Equal Sum Subarrays

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

Log in to rate problems.

개별 의견

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

풀이 제출

Equal Sum Subarrays

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