message stringlengths 2 44.5k | message_type stringclasses 2 values | message_id int64 0 1 | conversation_id int64 42 109k | cluster float64 5 5 | __index_level_0__ int64 84 217k |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Can you imagine our life if we removed all zeros from it? For sure we will have many problems.
In this problem we will have a simple example if we removed all zeros from our life, it's the addition operation. Let's assume you are given this equation a + b = c, where a and b are positive integers, and c is the sum of a and b. Now let's remove all zeros from this equation. Will the equation remain correct after removing all zeros?
For example if the equation is 101 + 102 = 203, if we removed all zeros it will be 11 + 12 = 23 which is still a correct equation.
But if the equation is 105 + 106 = 211, if we removed all zeros it will be 15 + 16 = 211 which is not a correct equation.
Input
The input will consist of two lines, the first line will contain the integer a, and the second line will contain the integer b which are in the equation as described above (1 ≤ a, b ≤ 109). There won't be any leading zeros in both. The value of c should be calculated as c = a + b.
Output
The output will be just one line, you should print "YES" if the equation will remain correct after removing all zeros, and print "NO" otherwise.
Examples
Input
101
102
Output
YES
Input
105
106
Output
NO
Submitted Solution:
```
a0 = int(input())
b0 = int(input())
s0 = a0 + b0
numbers = [a0, b0, s0]
i = 0
while i < 3:
num = numbers[i]
new_num, rank = 0, 0
while num > 0:
last = num % 10
if last != 0:
new_num += last * 10 ** rank
rank += 1
num //= 10
i += 1
numbers.append(new_num)
if numbers[3] + numbers[4] == numbers[5]:
print('YES')
else:
print('NO')
``` | instruction | 0 | 81,335 | 5 | 162,670 |
Yes | output | 1 | 81,335 | 5 | 162,671 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Can you imagine our life if we removed all zeros from it? For sure we will have many problems.
In this problem we will have a simple example if we removed all zeros from our life, it's the addition operation. Let's assume you are given this equation a + b = c, where a and b are positive integers, and c is the sum of a and b. Now let's remove all zeros from this equation. Will the equation remain correct after removing all zeros?
For example if the equation is 101 + 102 = 203, if we removed all zeros it will be 11 + 12 = 23 which is still a correct equation.
But if the equation is 105 + 106 = 211, if we removed all zeros it will be 15 + 16 = 211 which is not a correct equation.
Input
The input will consist of two lines, the first line will contain the integer a, and the second line will contain the integer b which are in the equation as described above (1 ≤ a, b ≤ 109). There won't be any leading zeros in both. The value of c should be calculated as c = a + b.
Output
The output will be just one line, you should print "YES" if the equation will remain correct after removing all zeros, and print "NO" otherwise.
Examples
Input
101
102
Output
YES
Input
105
106
Output
NO
Submitted Solution:
```
a, b = int(input()), int(input())
c = a + b
a, b, c = str(a), str(b), str(c)
a, b, c = int(a.replace("0", "")), int(b.replace("0", "")), int(c.replace("0", ""))
if a + b == c:
print("YES")
else:
print("NO")
``` | instruction | 0 | 81,336 | 5 | 162,672 |
Yes | output | 1 | 81,336 | 5 | 162,673 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Can you imagine our life if we removed all zeros from it? For sure we will have many problems.
In this problem we will have a simple example if we removed all zeros from our life, it's the addition operation. Let's assume you are given this equation a + b = c, where a and b are positive integers, and c is the sum of a and b. Now let's remove all zeros from this equation. Will the equation remain correct after removing all zeros?
For example if the equation is 101 + 102 = 203, if we removed all zeros it will be 11 + 12 = 23 which is still a correct equation.
But if the equation is 105 + 106 = 211, if we removed all zeros it will be 15 + 16 = 211 which is not a correct equation.
Input
The input will consist of two lines, the first line will contain the integer a, and the second line will contain the integer b which are in the equation as described above (1 ≤ a, b ≤ 109). There won't be any leading zeros in both. The value of c should be calculated as c = a + b.
Output
The output will be just one line, you should print "YES" if the equation will remain correct after removing all zeros, and print "NO" otherwise.
Examples
Input
101
102
Output
YES
Input
105
106
Output
NO
Submitted Solution:
```
def remove_zero(n):
s = list(str(n))
while(True):
if "0" in s:
s.remove("0")
else:
break
return int("".join(s))
a = int(input())
b = int(input())
c = a + b
if remove_zero(a) + remove_zero(b) == remove_zero(c):
print("YES")
else:
print("NO")
``` | instruction | 0 | 81,337 | 5 | 162,674 |
Yes | output | 1 | 81,337 | 5 | 162,675 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Can you imagine our life if we removed all zeros from it? For sure we will have many problems.
In this problem we will have a simple example if we removed all zeros from our life, it's the addition operation. Let's assume you are given this equation a + b = c, where a and b are positive integers, and c is the sum of a and b. Now let's remove all zeros from this equation. Will the equation remain correct after removing all zeros?
For example if the equation is 101 + 102 = 203, if we removed all zeros it will be 11 + 12 = 23 which is still a correct equation.
But if the equation is 105 + 106 = 211, if we removed all zeros it will be 15 + 16 = 211 which is not a correct equation.
Input
The input will consist of two lines, the first line will contain the integer a, and the second line will contain the integer b which are in the equation as described above (1 ≤ a, b ≤ 109). There won't be any leading zeros in both. The value of c should be calculated as c = a + b.
Output
The output will be just one line, you should print "YES" if the equation will remain correct after removing all zeros, and print "NO" otherwise.
Examples
Input
101
102
Output
YES
Input
105
106
Output
NO
Submitted Solution:
```
fN=int(input())
sN=int(input())
suM=fN+sN
fN,sN=str(fN).replace('0',''),str(sN).replace('0','')
suM=str(suM).replace('0','')
if int(fN)+int(sN)==int(suM):
print('YES')
else:
print('NO')
``` | instruction | 0 | 81,338 | 5 | 162,676 |
Yes | output | 1 | 81,338 | 5 | 162,677 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Can you imagine our life if we removed all zeros from it? For sure we will have many problems.
In this problem we will have a simple example if we removed all zeros from our life, it's the addition operation. Let's assume you are given this equation a + b = c, where a and b are positive integers, and c is the sum of a and b. Now let's remove all zeros from this equation. Will the equation remain correct after removing all zeros?
For example if the equation is 101 + 102 = 203, if we removed all zeros it will be 11 + 12 = 23 which is still a correct equation.
But if the equation is 105 + 106 = 211, if we removed all zeros it will be 15 + 16 = 211 which is not a correct equation.
Input
The input will consist of two lines, the first line will contain the integer a, and the second line will contain the integer b which are in the equation as described above (1 ≤ a, b ≤ 109). There won't be any leading zeros in both. The value of c should be calculated as c = a + b.
Output
The output will be just one line, you should print "YES" if the equation will remain correct after removing all zeros, and print "NO" otherwise.
Examples
Input
101
102
Output
YES
Input
105
106
Output
NO
Submitted Solution:
```
num1 = int(input())
num2 = int(input())
original_sum = num1 + num2
non_zero_num1 = ''
non_zero_num2 = ''
for x in str(num1):
if x == '0':
continue
else:
non_zero_num1 += x
for x in str(num2):
if x == '0':
continue
else:
non_zero_num2 += x
if int(non_zero_num2) + int(non_zero_num1) == original_sum:
print('YES')
else:
print('NO')
``` | instruction | 0 | 81,339 | 5 | 162,678 |
No | output | 1 | 81,339 | 5 | 162,679 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Can you imagine our life if we removed all zeros from it? For sure we will have many problems.
In this problem we will have a simple example if we removed all zeros from our life, it's the addition operation. Let's assume you are given this equation a + b = c, where a and b are positive integers, and c is the sum of a and b. Now let's remove all zeros from this equation. Will the equation remain correct after removing all zeros?
For example if the equation is 101 + 102 = 203, if we removed all zeros it will be 11 + 12 = 23 which is still a correct equation.
But if the equation is 105 + 106 = 211, if we removed all zeros it will be 15 + 16 = 211 which is not a correct equation.
Input
The input will consist of two lines, the first line will contain the integer a, and the second line will contain the integer b which are in the equation as described above (1 ≤ a, b ≤ 109). There won't be any leading zeros in both. The value of c should be calculated as c = a + b.
Output
The output will be just one line, you should print "YES" if the equation will remain correct after removing all zeros, and print "NO" otherwise.
Examples
Input
101
102
Output
YES
Input
105
106
Output
NO
Submitted Solution:
```
a = input()
b = input()
x = int(a)
y = int(b)
c = x + y
c = str(c)
while '0' in a and '0' in b and '0' in c:
a = a.replace('0', '')
b = b.replace('0', '')
c = c.replace('0', '')
x = int(a)
y = int(b)
c = int(c)
if c == x + y:
print('YES')
elif c != x + y:
print('NO')
``` | instruction | 0 | 81,340 | 5 | 162,680 |
No | output | 1 | 81,340 | 5 | 162,681 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Can you imagine our life if we removed all zeros from it? For sure we will have many problems.
In this problem we will have a simple example if we removed all zeros from our life, it's the addition operation. Let's assume you are given this equation a + b = c, where a and b are positive integers, and c is the sum of a and b. Now let's remove all zeros from this equation. Will the equation remain correct after removing all zeros?
For example if the equation is 101 + 102 = 203, if we removed all zeros it will be 11 + 12 = 23 which is still a correct equation.
But if the equation is 105 + 106 = 211, if we removed all zeros it will be 15 + 16 = 211 which is not a correct equation.
Input
The input will consist of two lines, the first line will contain the integer a, and the second line will contain the integer b which are in the equation as described above (1 ≤ a, b ≤ 109). There won't be any leading zeros in both. The value of c should be calculated as c = a + b.
Output
The output will be just one line, you should print "YES" if the equation will remain correct after removing all zeros, and print "NO" otherwise.
Examples
Input
101
102
Output
YES
Input
105
106
Output
NO
Submitted Solution:
```
def inverse(n):
inverse_number = 0
while n>0 :
if (n%10 == 0):
n = n//10
continue
else:
last = n%10
inverse_number = inverse_number*10 + last
n = n//10
return inverse_number
a= int(input())
b= int(input())
checkSum = inverse(inverse(a)+inverse(b))
initSum = inverse(inverse(a)) + inverse(inverse(b))
if (checkSum == initSum):
print("YES")
else:
print("NO")
``` | instruction | 0 | 81,341 | 5 | 162,682 |
No | output | 1 | 81,341 | 5 | 162,683 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Can you imagine our life if we removed all zeros from it? For sure we will have many problems.
In this problem we will have a simple example if we removed all zeros from our life, it's the addition operation. Let's assume you are given this equation a + b = c, where a and b are positive integers, and c is the sum of a and b. Now let's remove all zeros from this equation. Will the equation remain correct after removing all zeros?
For example if the equation is 101 + 102 = 203, if we removed all zeros it will be 11 + 12 = 23 which is still a correct equation.
But if the equation is 105 + 106 = 211, if we removed all zeros it will be 15 + 16 = 211 which is not a correct equation.
Input
The input will consist of two lines, the first line will contain the integer a, and the second line will contain the integer b which are in the equation as described above (1 ≤ a, b ≤ 109). There won't be any leading zeros in both. The value of c should be calculated as c = a + b.
Output
The output will be just one line, you should print "YES" if the equation will remain correct after removing all zeros, and print "NO" otherwise.
Examples
Input
101
102
Output
YES
Input
105
106
Output
NO
Submitted Solution:
```
a=int(input())
b=int(input())
print("NYOE S"[(a+b==int(str(a).replace('0',''))+int(str(b).replace('0','')))::2])
``` | instruction | 0 | 81,342 | 5 | 162,684 |
No | output | 1 | 81,342 | 5 | 162,685 |
Provide a correct Python 3 solution for this coding contest problem.
Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.
Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.
Constraints
* 1 \leq X \leq 100
* 0 \leq N \leq 100
* 1 \leq p_i \leq 100
* p_1, \ldots, p_N are all distinct.
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
X N
p_1 ... p_N
Output
Print the answer.
Examples
Input
6 5
4 7 10 6 5
Output
8
Input
10 5
4 7 10 6 5
Output
9
Input
100 0
Output
100 | instruction | 0 | 81,442 | 5 | 162,884 |
"Correct Solution:
```
X, N, *P = map(int, open(0).read().split())
cand = []
P = set(P)
for i in range(0, 102):
if i in P:
continue
cand.append((abs(X - i), i))
cand.sort()
print(cand[0][1])
``` | output | 1 | 81,442 | 5 | 162,885 |
Provide a correct Python 3 solution for this coding contest problem.
Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.
Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.
Constraints
* 1 \leq X \leq 100
* 0 \leq N \leq 100
* 1 \leq p_i \leq 100
* p_1, \ldots, p_N are all distinct.
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
X N
p_1 ... p_N
Output
Print the answer.
Examples
Input
6 5
4 7 10 6 5
Output
8
Input
10 5
4 7 10 6 5
Output
9
Input
100 0
Output
100 | instruction | 0 | 81,443 | 5 | 162,886 |
"Correct Solution:
```
X, N = map(int, input().split())
P = set(map(int, input().split()))
ans = 0
for i in range(102):
if i in P:
continue
if abs(X-ans) > abs(X-i):
ans = i
print(ans)
``` | output | 1 | 81,443 | 5 | 162,887 |
Provide a correct Python 3 solution for this coding contest problem.
Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.
Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.
Constraints
* 1 \leq X \leq 100
* 0 \leq N \leq 100
* 1 \leq p_i \leq 100
* p_1, \ldots, p_N are all distinct.
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
X N
p_1 ... p_N
Output
Print the answer.
Examples
Input
6 5
4 7 10 6 5
Output
8
Input
10 5
4 7 10 6 5
Output
9
Input
100 0
Output
100 | instruction | 0 | 81,444 | 5 | 162,888 |
"Correct Solution:
```
x,n = list(map(int,input().split()))
p= list(map(int,input().split()))
for i in range(x+1):
for s in [-1,+1]:
a=x+s*i
if a not in p:
print(a)
exit(0)
``` | output | 1 | 81,444 | 5 | 162,889 |
Provide a correct Python 3 solution for this coding contest problem.
Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.
Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.
Constraints
* 1 \leq X \leq 100
* 0 \leq N \leq 100
* 1 \leq p_i \leq 100
* p_1, \ldots, p_N are all distinct.
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
X N
p_1 ... p_N
Output
Print the answer.
Examples
Input
6 5
4 7 10 6 5
Output
8
Input
10 5
4 7 10 6 5
Output
9
Input
100 0
Output
100 | instruction | 0 | 81,445 | 5 | 162,890 |
"Correct Solution:
```
x,n=map(int,input().split())
b=float("INF")
ans=0
l=set(map(int,input().split()))
for i in range(-100,200):
if i in l:continue
if b>abs(x-i):
b=abs(x-i)
ans=i
print(ans)
``` | output | 1 | 81,445 | 5 | 162,891 |
Provide a correct Python 3 solution for this coding contest problem.
Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.
Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.
Constraints
* 1 \leq X \leq 100
* 0 \leq N \leq 100
* 1 \leq p_i \leq 100
* p_1, \ldots, p_N are all distinct.
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
X N
p_1 ... p_N
Output
Print the answer.
Examples
Input
6 5
4 7 10 6 5
Output
8
Input
10 5
4 7 10 6 5
Output
9
Input
100 0
Output
100 | instruction | 0 | 81,446 | 5 | 162,892 |
"Correct Solution:
```
x,n=map(int,input().split())
p=list(map(int,input().split()))
for i in range(x+1):
for s in [-1,1]:
a=x+i*s
if p.count(a)==0:
print(a)
exit(0)
``` | output | 1 | 81,446 | 5 | 162,893 |
Provide a correct Python 3 solution for this coding contest problem.
Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.
Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.
Constraints
* 1 \leq X \leq 100
* 0 \leq N \leq 100
* 1 \leq p_i \leq 100
* p_1, \ldots, p_N are all distinct.
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
X N
p_1 ... p_N
Output
Print the answer.
Examples
Input
6 5
4 7 10 6 5
Output
8
Input
10 5
4 7 10 6 5
Output
9
Input
100 0
Output
100 | instruction | 0 | 81,447 | 5 | 162,894 |
"Correct Solution:
```
X, N = map(int, input().split()) #6,5
p = list(map(int, input().split())) #[4,7,10,6,5]
q = [(abs(X-i),i) for i in range(0,102) if not i in p]
q.sort()
print(q[0][1])
``` | output | 1 | 81,447 | 5 | 162,895 |
Provide a correct Python 3 solution for this coding contest problem.
Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.
Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.
Constraints
* 1 \leq X \leq 100
* 0 \leq N \leq 100
* 1 \leq p_i \leq 100
* p_1, \ldots, p_N are all distinct.
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
X N
p_1 ... p_N
Output
Print the answer.
Examples
Input
6 5
4 7 10 6 5
Output
8
Input
10 5
4 7 10 6 5
Output
9
Input
100 0
Output
100 | instruction | 0 | 81,448 | 5 | 162,896 |
"Correct Solution:
```
x, n, *p = map(int, open(0).read().split())
ex = [0] * 102
for i in p: ex[i] = 1
ans = 0
for i in range(102):
if ex[i]==0 and abs(x-i)<abs(x-ans):
ans = i
print(ans)
``` | output | 1 | 81,448 | 5 | 162,897 |
Provide a correct Python 3 solution for this coding contest problem.
Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.
Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.
Constraints
* 1 \leq X \leq 100
* 0 \leq N \leq 100
* 1 \leq p_i \leq 100
* p_1, \ldots, p_N are all distinct.
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
X N
p_1 ... p_N
Output
Print the answer.
Examples
Input
6 5
4 7 10 6 5
Output
8
Input
10 5
4 7 10 6 5
Output
9
Input
100 0
Output
100 | instruction | 0 | 81,449 | 5 | 162,898 |
"Correct Solution:
```
X,N = map(int,input().split())
A = [int(i) for i in input().split()]
ans = 0
for i in range(1,102):
if i in A:
pass
else:
if abs(ans - X) > abs(i-X):
ans = i
print(ans)
``` | output | 1 | 81,449 | 5 | 162,899 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.
Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.
Constraints
* 1 \leq X \leq 100
* 0 \leq N \leq 100
* 1 \leq p_i \leq 100
* p_1, \ldots, p_N are all distinct.
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
X N
p_1 ... p_N
Output
Print the answer.
Examples
Input
6 5
4 7 10 6 5
Output
8
Input
10 5
4 7 10 6 5
Output
9
Input
100 0
Output
100
Submitted Solution:
```
x,_,*l=map(int,open(0).read().split())
print(min((abs(i-x),i) for i in {*range(102)}-{*l})[1])
``` | instruction | 0 | 81,450 | 5 | 162,900 |
Yes | output | 1 | 81,450 | 5 | 162,901 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.
Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.
Constraints
* 1 \leq X \leq 100
* 0 \leq N \leq 100
* 1 \leq p_i \leq 100
* p_1, \ldots, p_N are all distinct.
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
X N
p_1 ... p_N
Output
Print the answer.
Examples
Input
6 5
4 7 10 6 5
Output
8
Input
10 5
4 7 10 6 5
Output
9
Input
100 0
Output
100
Submitted Solution:
```
print(sorted((lambda n,p:[[p.count(i),abs(n[0]-i),i] for i in range(-1,102)])(list(map(int,input().split())),list(map(int,input().split()))))[0][2])
``` | instruction | 0 | 81,451 | 5 | 162,902 |
Yes | output | 1 | 81,451 | 5 | 162,903 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.
Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.
Constraints
* 1 \leq X \leq 100
* 0 \leq N \leq 100
* 1 \leq p_i \leq 100
* p_1, \ldots, p_N are all distinct.
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
X N
p_1 ... p_N
Output
Print the answer.
Examples
Input
6 5
4 7 10 6 5
Output
8
Input
10 5
4 7 10 6 5
Output
9
Input
100 0
Output
100
Submitted Solution:
```
x, n = map(int, input().split())
p = list(map(int, input().split()))
p = set(p)
res = 0
for i in range(0, 120):
if not i in p and abs(x - i) < abs(x - res):
res = i
print(res)
``` | instruction | 0 | 81,452 | 5 | 162,904 |
Yes | output | 1 | 81,452 | 5 | 162,905 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.
Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.
Constraints
* 1 \leq X \leq 100
* 0 \leq N \leq 100
* 1 \leq p_i \leq 100
* p_1, \ldots, p_N are all distinct.
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
X N
p_1 ... p_N
Output
Print the answer.
Examples
Input
6 5
4 7 10 6 5
Output
8
Input
10 5
4 7 10 6 5
Output
9
Input
100 0
Output
100
Submitted Solution:
```
X, N = map(int, input().split())
*P, = map(int, input().split())
cand = set(range(-50, 151)) - set(P)
cand = sorted([c for c in cand], key=lambda x: (abs(X - x), x))
print(cand[0])
``` | instruction | 0 | 81,453 | 5 | 162,906 |
Yes | output | 1 | 81,453 | 5 | 162,907 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.
Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.
Constraints
* 1 \leq X \leq 100
* 0 \leq N \leq 100
* 1 \leq p_i \leq 100
* p_1, \ldots, p_N are all distinct.
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
X N
p_1 ... p_N
Output
Print the answer.
Examples
Input
6 5
4 7 10 6 5
Output
8
Input
10 5
4 7 10 6 5
Output
9
Input
100 0
Output
100
Submitted Solution:
```
X,N = map(int, input().split())
try:
p = list(map(int, input().split()))
except EOFError:
p = []
int_list = [i for i in range(101)]
forbidden_list = list(set(int_list) - set(p))
num_X = int_list.index(X)
c = 10000000
if X in forbidden_list:
print(X)
else:
for i in range(len(forbidden_list) - 1):
a = abs(X - forbidden_list[i])
b = abs(X - forbidden_list[i + 1])
if a == b:
print(forbidden_list[i])
break
elif c > a:
c = a
elif c <= a and b > a:
print(forbidden_list[i - 1])
break
else:
print(forbidden_list[i])
break
else:
print(forbidden_list[-1])
``` | instruction | 0 | 81,454 | 5 | 162,908 |
No | output | 1 | 81,454 | 5 | 162,909 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.
Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.
Constraints
* 1 \leq X \leq 100
* 0 \leq N \leq 100
* 1 \leq p_i \leq 100
* p_1, \ldots, p_N are all distinct.
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
X N
p_1 ... p_N
Output
Print the answer.
Examples
Input
6 5
4 7 10 6 5
Output
8
Input
10 5
4 7 10 6 5
Output
9
Input
100 0
Output
100
Submitted Solution:
```
x, n = (int(x) for x in input().split())
p_list = list(map(int, input().split()))
ans = 0
max_ = 0
min_ = 0
# 増える側
for i in range(x, 100, 1) :
# print('i+')
# print(i)
if i not in p_list:
# print('確定')
max_ = i
break
# 減る側
for j in reversed(range(x + 1)) :
# print('j-')
# print(j)
if j not in p_list:
# print('確定')
min_ = j
break
# print('min')
# print(min_)
# print('max')
# print(max_)
if 0 in p_list and min_ == 0 :
ans = max_
else :
if abs (min_ - x) <= abs(max_ - x) :
ans = min_
else :
ans = max_
print(ans)
``` | instruction | 0 | 81,455 | 5 | 162,910 |
No | output | 1 | 81,455 | 5 | 162,911 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.
Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.
Constraints
* 1 \leq X \leq 100
* 0 \leq N \leq 100
* 1 \leq p_i \leq 100
* p_1, \ldots, p_N are all distinct.
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
X N
p_1 ... p_N
Output
Print the answer.
Examples
Input
6 5
4 7 10 6 5
Output
8
Input
10 5
4 7 10 6 5
Output
9
Input
100 0
Output
100
Submitted Solution:
```
import sys
X,N = map(int,input().split())
if N == 0:
print(X)
sys.exit()
p = list(map(int,input().split()))
num1 = X-1
num2 = X+1
while 1:
if num1 == 0:
print(num1)
break
if num1 in p and num2 not in p:
print(num2)
break
elif num1 not in p and num2 in p:
print(num1)
break
elif num1 not in p and num2 not in p:
print(num1)
break
else:
num1 -= 1
num2 += 1
``` | instruction | 0 | 81,456 | 5 | 162,912 |
No | output | 1 | 81,456 | 5 | 162,913 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.
Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.
Constraints
* 1 \leq X \leq 100
* 0 \leq N \leq 100
* 1 \leq p_i \leq 100
* p_1, \ldots, p_N are all distinct.
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
X N
p_1 ... p_N
Output
Print the answer.
Examples
Input
6 5
4 7 10 6 5
Output
8
Input
10 5
4 7 10 6 5
Output
9
Input
100 0
Output
100
Submitted Solution:
```
x, n = list(map(int, input().split()))
p = list(map(int, input().split()))
sample = list(range(0,max(p)+2))
reject = list(set(p))
for i in range(len(reject)):
sample.remove(reject[i])
champ = abs(sample[0] - x)
ans = sample[0]
for i in range(1, len(sample)):
if abs(sample[i] - x) < champ:
champ = abs(sample[i] - x)
ans = sample[i]
elif abs(sample[i] - x) == champ:
if ans >= sample[i]:
ans = sample[i]
else:
pass
else:
pass
print(ans)
``` | instruction | 0 | 81,457 | 5 | 162,914 |
No | output | 1 | 81,457 | 5 | 162,915 |
Provide a correct Python 3 solution for this coding contest problem.
A triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers.
You will be given three integers A, B, and C. If this triple is poor, print `Yes`; otherwise, print `No`.
Constraints
* A, B, and C are all integers between 1 and 9 (inclusive).
Input
Input is given from Standard Input in the following format:
A B C
Output
If the given triple is poor, print `Yes`; otherwise, print `No`.
Examples
Input
5 7 5
Output
Yes
Input
4 4 4
Output
No
Input
4 9 6
Output
No
Input
3 3 4
Output
Yes | instruction | 0 | 81,458 | 5 | 162,916 |
"Correct Solution:
```
l=list(map(int,input().split()))
print('Yes' if len(set(l))==2 else 'No')
``` | output | 1 | 81,458 | 5 | 162,917 |
Provide a correct Python 3 solution for this coding contest problem.
A triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers.
You will be given three integers A, B, and C. If this triple is poor, print `Yes`; otherwise, print `No`.
Constraints
* A, B, and C are all integers between 1 and 9 (inclusive).
Input
Input is given from Standard Input in the following format:
A B C
Output
If the given triple is poor, print `Yes`; otherwise, print `No`.
Examples
Input
5 7 5
Output
Yes
Input
4 4 4
Output
No
Input
4 9 6
Output
No
Input
3 3 4
Output
Yes | instruction | 0 | 81,459 | 5 | 162,918 |
"Correct Solution:
```
l=list(map(int,input().split()))
print("Yes" if len(set(l)) == 2 else "No")
``` | output | 1 | 81,459 | 5 | 162,919 |
Provide a correct Python 3 solution for this coding contest problem.
A triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers.
You will be given three integers A, B, and C. If this triple is poor, print `Yes`; otherwise, print `No`.
Constraints
* A, B, and C are all integers between 1 and 9 (inclusive).
Input
Input is given from Standard Input in the following format:
A B C
Output
If the given triple is poor, print `Yes`; otherwise, print `No`.
Examples
Input
5 7 5
Output
Yes
Input
4 4 4
Output
No
Input
4 9 6
Output
No
Input
3 3 4
Output
Yes | instruction | 0 | 81,460 | 5 | 162,920 |
"Correct Solution:
```
A=input().split()
if len(set(A))==2:
print("Yes")
else:
print("No")
``` | output | 1 | 81,460 | 5 | 162,921 |
Provide a correct Python 3 solution for this coding contest problem.
A triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers.
You will be given three integers A, B, and C. If this triple is poor, print `Yes`; otherwise, print `No`.
Constraints
* A, B, and C are all integers between 1 and 9 (inclusive).
Input
Input is given from Standard Input in the following format:
A B C
Output
If the given triple is poor, print `Yes`; otherwise, print `No`.
Examples
Input
5 7 5
Output
Yes
Input
4 4 4
Output
No
Input
4 9 6
Output
No
Input
3 3 4
Output
Yes | instruction | 0 | 81,461 | 5 | 162,922 |
"Correct Solution:
```
print("Yes" if len(set(input().split())) == 2 else "No")
``` | output | 1 | 81,461 | 5 | 162,923 |
Provide a correct Python 3 solution for this coding contest problem.
A triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers.
You will be given three integers A, B, and C. If this triple is poor, print `Yes`; otherwise, print `No`.
Constraints
* A, B, and C are all integers between 1 and 9 (inclusive).
Input
Input is given from Standard Input in the following format:
A B C
Output
If the given triple is poor, print `Yes`; otherwise, print `No`.
Examples
Input
5 7 5
Output
Yes
Input
4 4 4
Output
No
Input
4 9 6
Output
No
Input
3 3 4
Output
Yes | instruction | 0 | 81,462 | 5 | 162,924 |
"Correct Solution:
```
L = set(input().split())
print('Yes' if len(L) == 2 else 'No')
``` | output | 1 | 81,462 | 5 | 162,925 |
Provide a correct Python 3 solution for this coding contest problem.
A triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers.
You will be given three integers A, B, and C. If this triple is poor, print `Yes`; otherwise, print `No`.
Constraints
* A, B, and C are all integers between 1 and 9 (inclusive).
Input
Input is given from Standard Input in the following format:
A B C
Output
If the given triple is poor, print `Yes`; otherwise, print `No`.
Examples
Input
5 7 5
Output
Yes
Input
4 4 4
Output
No
Input
4 9 6
Output
No
Input
3 3 4
Output
Yes | instruction | 0 | 81,463 | 5 | 162,926 |
"Correct Solution:
```
s = set(map(int, input().split()))
print("Yes" if len(s) == 2 else "No")
``` | output | 1 | 81,463 | 5 | 162,927 |
Provide a correct Python 3 solution for this coding contest problem.
A triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers.
You will be given three integers A, B, and C. If this triple is poor, print `Yes`; otherwise, print `No`.
Constraints
* A, B, and C are all integers between 1 and 9 (inclusive).
Input
Input is given from Standard Input in the following format:
A B C
Output
If the given triple is poor, print `Yes`; otherwise, print `No`.
Examples
Input
5 7 5
Output
Yes
Input
4 4 4
Output
No
Input
4 9 6
Output
No
Input
3 3 4
Output
Yes | instruction | 0 | 81,464 | 5 | 162,928 |
"Correct Solution:
```
List = input().split()
print("Yes" if len(set(List)) == 2 else "No")
``` | output | 1 | 81,464 | 5 | 162,929 |
Provide a correct Python 3 solution for this coding contest problem.
A triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers.
You will be given three integers A, B, and C. If this triple is poor, print `Yes`; otherwise, print `No`.
Constraints
* A, B, and C are all integers between 1 and 9 (inclusive).
Input
Input is given from Standard Input in the following format:
A B C
Output
If the given triple is poor, print `Yes`; otherwise, print `No`.
Examples
Input
5 7 5
Output
Yes
Input
4 4 4
Output
No
Input
4 9 6
Output
No
Input
3 3 4
Output
Yes | instruction | 0 | 81,465 | 5 | 162,930 |
"Correct Solution:
```
print("YNeos"[len(set(map(int, input().split()))) != 2::2])
``` | output | 1 | 81,465 | 5 | 162,931 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers.
You will be given three integers A, B, and C. If this triple is poor, print `Yes`; otherwise, print `No`.
Constraints
* A, B, and C are all integers between 1 and 9 (inclusive).
Input
Input is given from Standard Input in the following format:
A B C
Output
If the given triple is poor, print `Yes`; otherwise, print `No`.
Examples
Input
5 7 5
Output
Yes
Input
4 4 4
Output
No
Input
4 9 6
Output
No
Input
3 3 4
Output
Yes
Submitted Solution:
```
ans = set(list(map(int,input().split())))
print('Yes' if len(ans) == 2 else 'No')
``` | instruction | 0 | 81,466 | 5 | 162,932 |
Yes | output | 1 | 81,466 | 5 | 162,933 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers.
You will be given three integers A, B, and C. If this triple is poor, print `Yes`; otherwise, print `No`.
Constraints
* A, B, and C are all integers between 1 and 9 (inclusive).
Input
Input is given from Standard Input in the following format:
A B C
Output
If the given triple is poor, print `Yes`; otherwise, print `No`.
Examples
Input
5 7 5
Output
Yes
Input
4 4 4
Output
No
Input
4 9 6
Output
No
Input
3 3 4
Output
Yes
Submitted Solution:
```
print("Yes" if len(set(list(map(int, input().split())))) == 2 else "No" )
``` | instruction | 0 | 81,467 | 5 | 162,934 |
Yes | output | 1 | 81,467 | 5 | 162,935 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers.
You will be given three integers A, B, and C. If this triple is poor, print `Yes`; otherwise, print `No`.
Constraints
* A, B, and C are all integers between 1 and 9 (inclusive).
Input
Input is given from Standard Input in the following format:
A B C
Output
If the given triple is poor, print `Yes`; otherwise, print `No`.
Examples
Input
5 7 5
Output
Yes
Input
4 4 4
Output
No
Input
4 9 6
Output
No
Input
3 3 4
Output
Yes
Submitted Solution:
```
s = set(input().split())
if len(s) == 2:
print("Yes")
else:
print("No")
``` | instruction | 0 | 81,468 | 5 | 162,936 |
Yes | output | 1 | 81,468 | 5 | 162,937 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers.
You will be given three integers A, B, and C. If this triple is poor, print `Yes`; otherwise, print `No`.
Constraints
* A, B, and C are all integers between 1 and 9 (inclusive).
Input
Input is given from Standard Input in the following format:
A B C
Output
If the given triple is poor, print `Yes`; otherwise, print `No`.
Examples
Input
5 7 5
Output
Yes
Input
4 4 4
Output
No
Input
4 9 6
Output
No
Input
3 3 4
Output
Yes
Submitted Solution:
```
lst = list(map(int, input().split()))
print('Yes' if len(set(lst)) == 2 else 'No')
``` | instruction | 0 | 81,469 | 5 | 162,938 |
Yes | output | 1 | 81,469 | 5 | 162,939 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers.
You will be given three integers A, B, and C. If this triple is poor, print `Yes`; otherwise, print `No`.
Constraints
* A, B, and C are all integers between 1 and 9 (inclusive).
Input
Input is given from Standard Input in the following format:
A B C
Output
If the given triple is poor, print `Yes`; otherwise, print `No`.
Examples
Input
5 7 5
Output
Yes
Input
4 4 4
Output
No
Input
4 9 6
Output
No
Input
3 3 4
Output
Yes
Submitted Solution:
```
L = list(map(int,input().split()))
A = L[0]
B = L[1]
C = L[2]
if A == B != C or A == C != B or A != B = C:
print('Yes')
else:
print('No')
``` | instruction | 0 | 81,470 | 5 | 162,940 |
No | output | 1 | 81,470 | 5 | 162,941 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers.
You will be given three integers A, B, and C. If this triple is poor, print `Yes`; otherwise, print `No`.
Constraints
* A, B, and C are all integers between 1 and 9 (inclusive).
Input
Input is given from Standard Input in the following format:
A B C
Output
If the given triple is poor, print `Yes`; otherwise, print `No`.
Examples
Input
5 7 5
Output
Yes
Input
4 4 4
Output
No
Input
4 9 6
Output
No
Input
3 3 4
Output
Yes
Submitted Solution:
```
# coding: utf-8
# Your code here!
A,B,C = map(int,input().split())
if A == B and B == C:
print("No")
elif A == B or B ==C or A == C:
print("Yse")
else:
print("No")
``` | instruction | 0 | 81,471 | 5 | 162,942 |
No | output | 1 | 81,471 | 5 | 162,943 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers.
You will be given three integers A, B, and C. If this triple is poor, print `Yes`; otherwise, print `No`.
Constraints
* A, B, and C are all integers between 1 and 9 (inclusive).
Input
Input is given from Standard Input in the following format:
A B C
Output
If the given triple is poor, print `Yes`; otherwise, print `No`.
Examples
Input
5 7 5
Output
Yes
Input
4 4 4
Output
No
Input
4 9 6
Output
No
Input
3 3 4
Output
Yes
Submitted Solution:
```
n=int(input())
a=list(map(int,input().split()))
ans="APPROVED"
for i in range (n):
if a[i]%2==0:
if a[i]%3!=0and a[i]%5!=0:
ans="DENIED"
else:
ans="APRROVED"
print(ans)
``` | instruction | 0 | 81,472 | 5 | 162,944 |
No | output | 1 | 81,472 | 5 | 162,945 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers.
You will be given three integers A, B, and C. If this triple is poor, print `Yes`; otherwise, print `No`.
Constraints
* A, B, and C are all integers between 1 and 9 (inclusive).
Input
Input is given from Standard Input in the following format:
A B C
Output
If the given triple is poor, print `Yes`; otherwise, print `No`.
Examples
Input
5 7 5
Output
Yes
Input
4 4 4
Output
No
Input
4 9 6
Output
No
Input
3 3 4
Output
Yes
Submitted Solution:
```
a, b, c = list(map(int, input.split()))
if a == b == c:
print('No')
elif a != b and a != c and b != c:
print('No')
else:
print('Yes')
``` | instruction | 0 | 81,473 | 5 | 162,946 |
No | output | 1 | 81,473 | 5 | 162,947 |
Provide a correct Python 3 solution for this coding contest problem.
There are N integers written on a blackboard. The i-th integer is A_i.
Takahashi will repeatedly perform the following operation on these numbers:
* Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.
* Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.
Determine whether it is possible to have only one integer on the blackboard.
Constraints
* 2 ≦ N ≦ 10^5
* 1 ≦ A_i ≦ 10^9
* A_i is an integer.
Input
The input is given from Standard Input in the following format:
N
A_1 A_2 … A_N
Output
If it is possible to have only one integer on the blackboard, print `YES`. Otherwise, print `NO`.
Examples
Input
3
1 2 3
Output
YES
Input
5
1 2 3 4 5
Output
NO | instruction | 0 | 81,570 | 5 | 163,140 |
"Correct Solution:
```
N = int(input())
A = [int(a) for a in input().split()]
odd = 0
for a in A:
odd += a%2
print("YES" if odd%2==0 else "NO")
``` | output | 1 | 81,570 | 5 | 163,141 |
Provide a correct Python 3 solution for this coding contest problem.
There are N integers written on a blackboard. The i-th integer is A_i.
Takahashi will repeatedly perform the following operation on these numbers:
* Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.
* Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.
Determine whether it is possible to have only one integer on the blackboard.
Constraints
* 2 ≦ N ≦ 10^5
* 1 ≦ A_i ≦ 10^9
* A_i is an integer.
Input
The input is given from Standard Input in the following format:
N
A_1 A_2 … A_N
Output
If it is possible to have only one integer on the blackboard, print `YES`. Otherwise, print `NO`.
Examples
Input
3
1 2 3
Output
YES
Input
5
1 2 3 4 5
Output
NO | instruction | 0 | 81,571 | 5 | 163,142 |
"Correct Solution:
```
_,*A=map(int,open(0).read().split())
print(['YES','NO'][sum(A)%2])
``` | output | 1 | 81,571 | 5 | 163,143 |
Provide a correct Python 3 solution for this coding contest problem.
There are N integers written on a blackboard. The i-th integer is A_i.
Takahashi will repeatedly perform the following operation on these numbers:
* Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.
* Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.
Determine whether it is possible to have only one integer on the blackboard.
Constraints
* 2 ≦ N ≦ 10^5
* 1 ≦ A_i ≦ 10^9
* A_i is an integer.
Input
The input is given from Standard Input in the following format:
N
A_1 A_2 … A_N
Output
If it is possible to have only one integer on the blackboard, print `YES`. Otherwise, print `NO`.
Examples
Input
3
1 2 3
Output
YES
Input
5
1 2 3 4 5
Output
NO | instruction | 0 | 81,572 | 5 | 163,144 |
"Correct Solution:
```
N = int(input())
A = [int(i) for i in input().split()]
print('YES') if sum(A) % 2 == 0 else print('NO')
``` | output | 1 | 81,572 | 5 | 163,145 |
Provide a correct Python 3 solution for this coding contest problem.
There are N integers written on a blackboard. The i-th integer is A_i.
Takahashi will repeatedly perform the following operation on these numbers:
* Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.
* Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.
Determine whether it is possible to have only one integer on the blackboard.
Constraints
* 2 ≦ N ≦ 10^5
* 1 ≦ A_i ≦ 10^9
* A_i is an integer.
Input
The input is given from Standard Input in the following format:
N
A_1 A_2 … A_N
Output
If it is possible to have only one integer on the blackboard, print `YES`. Otherwise, print `NO`.
Examples
Input
3
1 2 3
Output
YES
Input
5
1 2 3 4 5
Output
NO | instruction | 0 | 81,573 | 5 | 163,146 |
"Correct Solution:
```
input();print('YNEOS'[sum(int(i)%2for i in input().split())%2::2])
``` | output | 1 | 81,573 | 5 | 163,147 |
Provide a correct Python 3 solution for this coding contest problem.
There are N integers written on a blackboard. The i-th integer is A_i.
Takahashi will repeatedly perform the following operation on these numbers:
* Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.
* Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.
Determine whether it is possible to have only one integer on the blackboard.
Constraints
* 2 ≦ N ≦ 10^5
* 1 ≦ A_i ≦ 10^9
* A_i is an integer.
Input
The input is given from Standard Input in the following format:
N
A_1 A_2 … A_N
Output
If it is possible to have only one integer on the blackboard, print `YES`. Otherwise, print `NO`.
Examples
Input
3
1 2 3
Output
YES
Input
5
1 2 3 4 5
Output
NO | instruction | 0 | 81,574 | 5 | 163,148 |
"Correct Solution:
```
N=int(input())
A=list(map(lambda x: int(x)%2, input().split()))
if A.count(1)%2==0 or 0 not in A:
print('YES')
else:
print('NO')
``` | output | 1 | 81,574 | 5 | 163,149 |
Provide a correct Python 3 solution for this coding contest problem.
There are N integers written on a blackboard. The i-th integer is A_i.
Takahashi will repeatedly perform the following operation on these numbers:
* Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.
* Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.
Determine whether it is possible to have only one integer on the blackboard.
Constraints
* 2 ≦ N ≦ 10^5
* 1 ≦ A_i ≦ 10^9
* A_i is an integer.
Input
The input is given from Standard Input in the following format:
N
A_1 A_2 … A_N
Output
If it is possible to have only one integer on the blackboard, print `YES`. Otherwise, print `NO`.
Examples
Input
3
1 2 3
Output
YES
Input
5
1 2 3 4 5
Output
NO | instruction | 0 | 81,575 | 5 | 163,150 |
"Correct Solution:
```
N = int(input())
A = list(map(int,input().split()))
odds = len([1 for a in A if a%2])
print('YES' if odds%2==0 else 'NO')
``` | output | 1 | 81,575 | 5 | 163,151 |
Provide a correct Python 3 solution for this coding contest problem.
There are N integers written on a blackboard. The i-th integer is A_i.
Takahashi will repeatedly perform the following operation on these numbers:
* Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.
* Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.
Determine whether it is possible to have only one integer on the blackboard.
Constraints
* 2 ≦ N ≦ 10^5
* 1 ≦ A_i ≦ 10^9
* A_i is an integer.
Input
The input is given from Standard Input in the following format:
N
A_1 A_2 … A_N
Output
If it is possible to have only one integer on the blackboard, print `YES`. Otherwise, print `NO`.
Examples
Input
3
1 2 3
Output
YES
Input
5
1 2 3 4 5
Output
NO | instruction | 0 | 81,576 | 5 | 163,152 |
"Correct Solution:
```
n=int(input())
a=list(map(int,input().split()))
o=0
for x in a:
if x%2!=0:o+=1
if o%2==1:print("NO")
else:print("YES")
``` | output | 1 | 81,576 | 5 | 163,153 |
Provide a correct Python 3 solution for this coding contest problem.
There are N integers written on a blackboard. The i-th integer is A_i.
Takahashi will repeatedly perform the following operation on these numbers:
* Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.
* Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.
Determine whether it is possible to have only one integer on the blackboard.
Constraints
* 2 ≦ N ≦ 10^5
* 1 ≦ A_i ≦ 10^9
* A_i is an integer.
Input
The input is given from Standard Input in the following format:
N
A_1 A_2 … A_N
Output
If it is possible to have only one integer on the blackboard, print `YES`. Otherwise, print `NO`.
Examples
Input
3
1 2 3
Output
YES
Input
5
1 2 3 4 5
Output
NO | instruction | 0 | 81,577 | 5 | 163,154 |
"Correct Solution:
```
n = int(input())
a = list(filter(lambda x: int(x) % 2 == 1, input().split()))
print('YES' if len(a) % 2 == 0 else 'NO')
``` | output | 1 | 81,577 | 5 | 163,155 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are N integers written on a blackboard. The i-th integer is A_i.
Takahashi will repeatedly perform the following operation on these numbers:
* Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.
* Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.
Determine whether it is possible to have only one integer on the blackboard.
Constraints
* 2 ≦ N ≦ 10^5
* 1 ≦ A_i ≦ 10^9
* A_i is an integer.
Input
The input is given from Standard Input in the following format:
N
A_1 A_2 … A_N
Output
If it is possible to have only one integer on the blackboard, print `YES`. Otherwise, print `NO`.
Examples
Input
3
1 2 3
Output
YES
Input
5
1 2 3 4 5
Output
NO
Submitted Solution:
```
n,*a=map(int,open(0).read().split());print("YNEOS"[sum(map(lambda x:x%2, a))%2::2])
``` | instruction | 0 | 81,578 | 5 | 163,156 |
Yes | output | 1 | 81,578 | 5 | 163,157 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are N integers written on a blackboard. The i-th integer is A_i.
Takahashi will repeatedly perform the following operation on these numbers:
* Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.
* Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.
Determine whether it is possible to have only one integer on the blackboard.
Constraints
* 2 ≦ N ≦ 10^5
* 1 ≦ A_i ≦ 10^9
* A_i is an integer.
Input
The input is given from Standard Input in the following format:
N
A_1 A_2 … A_N
Output
If it is possible to have only one integer on the blackboard, print `YES`. Otherwise, print `NO`.
Examples
Input
3
1 2 3
Output
YES
Input
5
1 2 3 4 5
Output
NO
Submitted Solution:
```
N = int(input())
Ai = list(map(int, input().split()))
gokei = sum(Ai)
if gokei % 2 == 1:
print('NO')
else:
print('YES')
``` | instruction | 0 | 81,579 | 5 | 163,158 |
Yes | output | 1 | 81,579 | 5 | 163,159 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.