We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
소스 코드
누적합 배열에서 특정 구간 [i, j]의 합은 다음과 같다. $$S_{j} - S_{i-1} ~~~(S_{0} = 0)$$
// 누적합 배열 생성 for(int i = 1; i<=N; ++i) { cin >> v[i]; if(i > 1) { v[i] += v[i-1]; } } // 구간 합 출력 for(int i = 1; i<=M; ++i) { int m, n; cin >> m >> n; cout << v[n] - v[m-1] << endl; }
The text was updated successfully, but these errors were encountered:
minsoo0715
No branches or pull requests
11659: 구간 합 구하기 4
소스 코드
아이디어
누적합 배열에서 특정 구간 [i, j]의 합은 다음과 같다.
$$S_{j} - S_{i-1} ~~~(S_{0} = 0)$$
구현
The text was updated successfully, but these errors were encountered: