CF1110A.Parity

入门

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

You are given an integer nn (n≥0n \ge 0) represented with kk digits in base (radix) bb. So,

n=a_1cdotbk−1+a_2cdotbk−2+ldotsa_k−1cdotb+a_k.n = a\_1 \\cdot b^{k-1} + a\_2 \\cdot b^{k-2} + \\ldots a\_{k-1} \\cdot b + a\_k.

For example, if b=17,k=3b=17, k=3 and a=[11,15,7]a=[11, 15, 7] then n=11⋅172+15⋅17+7=3179+255+7=3441n=11\cdot17^2+15\cdot17+7=3179+255+7=3441.

Determine whether nn is even or odd.

给你一个整数 nn(n≥0n \ge 0),它在 bb 进制(基数为 bb)下用 kk 位数字表示。即,

n=a_1cdotbk−1+a_2cdotbk−2+ldots+a_k−1cdotb+a_k.n = a\_1 \\cdot b^{k-1} + a\_2 \\cdot b^{k-2} + \\ldots + a\_{k-1} \\cdot b + a\_k.

例如,若 b=17, k=3b=17,\ k=3 且 a=[11, 15, 7]a=[11,\ 15,\ 7],则 n=11⋅172+15⋅17+7=3179+255+7=3441n=11\cdot17^2+15\cdot17+7=3179+255+7=3441。

判断 nn 是偶数还是奇数。

输入格式

The first line contains two integers bb and kk (2≤b≤1002\le b\le 100, 1≤k≤1051\le k\le 10^5) — the base of the number and the number of digits.

The second line contains kk integers a1,a2,…,aka_1, a_2, \ldots, a_k (0≤ai<b0\le a_i \lt b) — the digits of nn.

The representation of nn contains no unnecessary leading zero. That is, a1a_1 can be equal to 00 only if k=1k = 1.

第一行包含两个整数 bb 和 kk(2≤b≤1002\le b\le 100,1≤k≤1051\le k\le 10^5)—— 分别表示该数的进制和位数。

第二行包含 kk 个整数 a1,a2,…,aka_1, a_2, \ldots, a_k(0≤ai<b0\le a_i \lt b)—— 表示 nn 的各位数字。

nn 的表示中不含多余的前导零。即,仅当 k=1k = 1 时,a1a_1 才可以等于 00。

输出格式

Print "even" if nn is even, otherwise print "odd".

You can print each letter in any case (upper or lower).

如果 nn 是偶数,则输出 "even",否则输出 "odd"。

每个字母的大小写不限(大写或小写均可)。

输入输出样例

  • 输入#1

    13 3
    3 2 7

    输出#1

    even
  • 输入#2

    10 9
    1 2 3 4 5 6 7 8 9

    输出#2

    odd
  • 输入#3

    99 5
    32 92 85 74 4

    输出#3

    odd
  • 输入#4

    2 2
    1 0

    输出#4

    even

说明/提示

In the first example, n=3⋅132+2⋅13+7=540n = 3 \cdot 13^2 + 2 \cdot 13 + 7 = 540, which is even.

In the second example, n=123456789n = 123456789 is odd.

In the third example, n=32⋅994+92⋅993+85⋅992+74⋅99+4=3164015155n = 32 \cdot 99^4 + 92 \cdot 99^3 + 85 \cdot 99^2 + 74 \cdot 99 + 4 = 3164015155 is odd.

In the fourth example n=2n = 2.

在第一个例子中,n=3⋅132+2⋅13+7=540n = 3 \cdot 13^2 + 2 \cdot 13 + 7 = 540,为偶数。

在第二个例子中,n=123456789n = 123456789 为奇数。

在第三个例子中,n=32⋅994+92⋅993+85⋅992+74⋅99+4=3164015155n = 32 \cdot 99^4 + 92 \cdot 99^3 + 85 \cdot 99^2 + 74 \cdot 99 + 4 = 3164015155 为奇数。

在第四个例子中,n=2n = 2。

输入解题思路,AI测评打分。不知道怎么写?

首页