c语言sscanf函数的用法是什么
219
2022-09-16
cfA. Odds and Ends
A. Odds and Ends
time limit per test
memory limit per test
input
output
Where do odds begin, and where do they end? Where does hope emerge, and will they ever break?
a1, a2, ..., an of length n. Decide whether it is possible to divide it into an odd number of non-empty subsegments, the each of which has an odd length and begins and ends with odd numbers.
subsegment is a contiguous slice of the whole sequence. For example, {3, 4, 5} and {1} are subsegments of sequence {1, 2, 3, 4, 5, 6}, while {1, 2, 4} and {7}
Input
n (1 ≤ n ≤ 100) — the length of the sequence.
n space-separated non-negative integers a1, a2, ..., an (0 ≤ ai) — the elements of the sequence.
Output
Yes" if it's possible to fulfill the requirements, and "No" otherwise.
You can output each letter in any case (upper or lower).
是个思路,不要被题意迷惑,第一和最后一个为偶数就是no。
如果是偶数个数也是no。
其他可以是1整个数列。{1,2,2,2,2,2,2,2,1}是一个
#include 很尴尬第二题都想不出来。
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~