欧姆龙编程竞赛 2026(第 479 场 AtCoder Beginner Contest)
奇数下标之和AI (CI翻译)
Problem Statement
题目描述
AI (CI翻译)You are given an integer sequence of length $N$: $A=(A_1,A_2,\dots,A_N)$.
Find the sum of the odd-indexed terms of $A$.
More formally, find the sum of $A_i$ over all odd $i$ satisfying $1 \le i \le N$.
给定一个长度为 $N$ 的整数序列:$A=(A_1,A_2,\dots,A_N)$。
求 $A$ 中所有奇数下标项的和。
更准确地说,求所有满足 $1 \le i \le N$ 且 $i$ 为奇数的 $A_i$ 之和。AI (CI翻译)
Constraints
约束条件
AI (CI翻译)- All input values are integers.
$1 \le N \le 100$$1 \le A_i \le 100$
- 输入的所有值均为整数。
$1 \le N \le 100$$1 \le A_i \le 100$
Input
输入格式
AI (CI翻译)The input is given from Standard Input in the following format:
输入从标准输入按以下格式给出:AI (CI翻译)
N
A_1 A_2 \dots A_N
N
A_1 A_2 \dots A_NAI (CI翻译)
Output
输出格式
AI (CI翻译)Output the answer.
输出答案。AI (CI翻译)
样例
Input #1
5
3 1 4 1 5
Output #1
12
In this input, $A=(3,1,4,1,5)$, and the terms to be summed are $A_1,A_3,A_5$.
Output their sum, that is, $3+4+5=12$.
Input #2
6
2 7 1 8 2 8
Output #2
5
In this input, $A=(2,7,1,8,2,8)$, and the terms to be summed are $A_1,A_3,A_5$.
Output their sum, that is, $2+1+2=5$.
Input #3
9
100 40 30 50 20 90 100 80 60
Output #3
310
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。