AT_abc473_a.Second Half Sum
入门
通过率:0%
时间限制:2.00s
内存限制:1024MB
AC君温馨提醒
该题目为【atcoder】题库的题目,您提交的代码将被提交至atcoder进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given an integer sequence of length N: A=(A1,A2,…,AN). Here, N is even.
Find the sum of the latter half of A, that is, the sum of A(N/2)+1,A(N/2)+2,…,AN.
给你一个长度为 N 的整数序列:A=(A1,A2,…,AN)。其中,N 为偶数。
求 A 的后半部分的元素之和,即 A(N/2)+1,A(N/2)+2,…,AN 的和。
输入格式
The input is given from Standard Input in the following format:
N
A1 A2 … AN
输入从标准输入中按以下格式给出:
N
A1 A2 … AN
输出格式
Output the answer.
输出答案。
输入输出样例
输入#1
8 1 3 7 8 4 2 5 6
输出#1
17
输入#2
2 1 100
输出#2
100
输入#3
10 31 41 59 26 53 58 97 93 23 84
输出#3
355
说明/提示
Sample 1 Explanation:
The length of the sequence A is N=8, and you should find the sum of A5,A6,A7,A8.
Since A5+A6+A7+A8=4+2+5+6=17, output 17.
Constraints
- All input values are integers.
- N is an even number satisfying 2≤N≤100.
- 1≤Ai≤100
样例 1 解释:
序列 A 的长度为 N=8,你需要计算 A5,A6,A7,A8 的和。
由于 A5+A6+A7+A8=4+2+5+6=17,因此输出 17。
约束条件
- 所有输入值均为整数。
- N 是满足 2≤N≤100 的偶数。
- 1≤Ai≤100
输入解题思路,AI测评打分。不知道怎么写?