페이지를 불러오는 중…
해결한 사람
1
명
정답률
100.00
%
시간 제한
1000
ms
메모리 제한
2048
MB
The Quechuas welcome you to IOI 2025 with a special gift: two arrays, and , each of length . The elements in both arrays are indexed from to .
To ensure that you are taking good care of their gift, they will ask you questions, one at a time. Each question consists of two indices, and , and asks: What is the sum of and ?
The first procedure you should implement is:
void initialize(std::vector<int> A, std::vector<int> B)
answer_question.The second procedure you should implement is:
int answer_question(int i, int j)
This procedure should return the sum of and .
| 번호 | 배점 | 제한 |
|---|---|---|
| 1 | 25 | All elements in array are equal and all elements in array are equal. |
| 2 | 35 | |
| 3 | 40 | No additional constraints. |
Consider the following call:
initialize([2, 1, 3], [0, 7, 8])
In this case and the two arrays gifted to you are and .
Now consider the following call:
answer_question(0, 1)
This call should return the sum of and , which is .
Consider the following call:
answer_question(2, 2)
This call should return .
Input format:
N
A[0] A[1] ... A[N-1]
B[0] B[1] ... B[N-1]
Q
i[0] j[0]
i[1] j[1]
...
i[Q-1] j[Q-1]
Here, and () specify the parameters for each call to answer_question.
Output Format:
S[0]
S[1]
...
S[Q-1]
Here, () is the integer returned by the call answer_question(i[k], j[k]).
N
A[0] A[1] ... A[N-1]
B[0] B[1] ... B[N-1]
Q
i[0] j[0]
i[1] j[1]
...
i[Q-1] j[Q-1]
Here, and () specify the parameters for each call to answer_question.
S[0]
S[1]
...
S[Q-1]
Here, () is the integer returned by the call answer_question(i[k], j[k]).
3
2 1 3
0 7 8
2
0 1
2 2
9
11
International Olympiad in Informatics (IOI) 2025, official task package; Korean translation by Reporch.
Reporch에서 한국어 번역, 수식 표기, 이미지 호스팅 및 형식을 수정했습니다.
로그인 상태를 확인하는 중입니다.