description stringlengths 171 4k | code stringlengths 94 3.98k | normalized_code stringlengths 57 4.99k |
|---|---|---|
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
while t != 0:
n, x = map(int, input().split())
list1 = list(map(int, input().split()))
set1 = set()
sum1 = 0
flag = 0
for i in range(len(list1)):
temp = list1[i] - x
if temp == 0:
flag = 1
sum1 += temp
set1.add(temp)
if flag == 1 a... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP VAR VAR VAR IF VAR NU... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for h in range(int(input())):
n, x = map(int, input().strip().split())
arr = list(map(int, input().strip().split()))
sumi = 0
c = 0
for i in arr:
if i != x:
sumi += i
c += 1
if c == 0:
print(0)
elif sumi / c == x or c < n:
print(1)
else:
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR VAR VAR VAR NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER IF BIN_O... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def f():
t = int(input())
arr = []
for _ in range(t):
n, x = tuple(map(int, input().split()))
arr.append((n, x, tuple(map(int, input().split()))))
for n, x, ratings in arr:
infected = sum([(1) for r in ratings if r == x])
if infected == n:
print(0)
eli... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR VAR VAR VAR ASSIGN VAR FUNC_CALL VAR NUMBER VAR VAR VAR VAR IF VAR V... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for _ in range(int(input())):
n, k = map(int, input().split())
a = list(map(int, input().split()))
same = 0
if k in a:
same = 1
if len(set(a)) == 1 and a[0] == k:
print(0)
else:
ch = 0
for i in a:
ch += i - k
if ch == 0 or same > 0:
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER IF VAR VAR ASSIGN VAR NUMBER IF FUNC_CALL VAR FUNC_CALL VAR VAR NUMBER VAR NUMBER VAR EXPR FUNC_CALL VAR NUMBER ASSIGN VAR NUMBE... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for q in range(int(input())):
n, x = map(int, input().split())
a = list(map(int, input().split()))
print(
0
if sum([(1) for i in range(n) if a[i] == x]) == n
else (
1
if any([(1) for i in range(n) if a[i] == x])
or sum([(a[i] - x) for i in range(n)... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR NUMBER VAR FUNC_CALL VAR VAR VAR VAR VAR VAR NUMBER FUNC_CALL VAR NUMBER VAR FUNC_CALL VAR VAR VAR VAR VAR FUNC_C... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
while t:
t -= 1
n, x = list(map(int, input().split()))
s = list(map(int, input().split()))
suma = 0
c = 1
c2 = 0
for i in s:
suma += i
if i != x:
c = 0
if i == x:
c2 = 1
if c:
print(0)
elif suma / n == x or c2:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR VAR VAR IF VAR VAR ASSIGN VAR NUMBER IF VAR VAR ASSIGN V... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = eval(input())
for i in range(t):
pp = input()
p = [int(x) for x in pp.split()]
n = p[0]
y = p[1]
qq = input()
q = [int(x) for x in qq.split()]
if all(j == y for j in q):
print(0)
else:
s = 0
for x in q:
s += x
if s == n * y or y in q:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR IF FUNC_CALL VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR NUMBER ASSIGN V... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def checkinfection(array, x):
s = sum(array)
flag = 0
flag2 = 0
for element in array:
if element != x:
flag = 1
if element == x:
flag2 = 1
if flag == 0:
return 0
elif flag2 == 1:
return 1
elif sum(array) == x * len(array):
retur... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR ASSIGN VAR NUMBER IF VAR VAR ASSIGN VAR NUMBER IF VAR NUMBER RETURN NUMBER IF VAR NUMBER RETURN NUMBER IF FUNC_CALL VAR VAR BIN_OP VAR FUNC_CALL VAR VAR RETURN NUMBER RETURN NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
while t:
t += -1
n, x = map(int, input().split())
l = list(map(int, input().split()))
if len(set(l)) == 1 and l[0] == x:
print(0)
elif sum(l) / n == x:
print(1)
else:
ch = 0
for i in l:
if i == x:
ch = 1
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF FUNC_CALL VAR FUNC_CALL VAR VAR NUMBER VAR NUMBER VAR EXPR FUNC_CALL VAR NUMBER IF BIN_OP FUNC_CALL VAR VAR VAR VAR EXPR FUNC_CALL VA... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for j in range(int(input())):
n, vir = input().split()
a = [int(x) for x in input().split()]
neg, pos = 0, 0
if all(map(lambda x: x == int(vir), a)):
print(0)
elif any(map(lambda x: x == int(vir), a)):
print(1)
else:
for i in a:
if i < int(vir):
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR NUMBER NUMBER IF FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR NUMBER IF FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL VAR VAR VAR EXPR ... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for _ in range(int(input())):
n, x = list(map(int, input().split()))
arr = list(map(int, input().split()))
if set(arr) == {x}:
print(0)
continue
s = sum(arr)
if s // n * n == s and s // n == x or x in arr:
print(1)
else:
print(2) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR IF BIN_OP BIN_OP VAR VAR VAR VAR BIN_OP VAR VAR VAR ... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def solve():
n, x = map(int, input().split())
p = list(map(int, input().split()))
ok = True if x in p else False
if p == [x] * n:
print(0)
elif ok:
print(1)
else:
k = 0
for i in p[: n - 1]:
k += i - x
p[-1] += k
if p[-1] == x:
... | FUNC_DEF ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR VAR NUMBER NUMBER IF VAR BIN_OP LIST VAR VAR EXPR FUNC_CALL VAR NUMBER IF VAR EXPR FUNC_CALL VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR BIN_OP VAR NUMBER VAR BIN_OP VAR VAR V... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
for i in range(t):
x = 0
n, k = map(int, input().split())
a = list(map(int, input().split()))
for j in range(n):
x = x + a[j]
if k in a or k == x / n:
if a.count(a[0]) == n and a[0] == k:
print("0")
else:
print("1")
else:
p... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP VAR VAR VAR IF VAR VAR VAR BIN_OP VAR VAR IF FUNC_CALL VAR VAR NUMBER... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for _ in range(int(input())):
n, x = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
if a.count(x) == 0:
less = 0
more = 0
for i in a:
if i < x:
less += x - i
else:
more += i - x
if more == less:
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR IF FUNC_CALL VAR VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR VAR BIN_OP VAR VAR VAR BIN_OP VAR VAR IF VAR VAR EXPR FUNC_CALL V... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for _ in range(int(input())):
n, x = map(int, input().split())
a = list(map(int, input().split()))
if sum(a) == n * x:
flag = False
for rating in a:
if rating != x:
flag = True
break
if flag:
print(1)
else:
p... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF FUNC_CALL VAR VAR BIN_OP VAR VAR ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR ASSIGN VAR NUMBER IF VAR EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for _ in range(int(input())):
n, x = input().split()
n = int(n)
x = int(x)
l = list(map(int, input().split()))
countx = 0
netsum = 0
for i in l:
if i == x:
countx += 1
netsum += x - i
if countx == n:
print(0)
elif netsum == 0 or countx != 0:
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR VAR NUMBER VAR BIN_OP VAR VAR IF VAR VAR EXPR F... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
for i in range(t):
n, x = list(map(int, input().split()))
nums = list(map(int, input().split()))
diff_num = False
has_same = False
r = []
for n in nums:
if n != x:
diff_num = True
if n == x:
has_same = True
r.append(x - n)
if d... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR LIST FOR VAR VAR IF VAR VAR ASSIGN VAR NUMBER IF VAR VAR ASSIGN VAR NU... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | import sys
def check(n, x, a):
for h in range(n):
if a[h] != x:
return False
return True
t = int(sys.stdin.readline())
ans_arr = []
for i in range(t):
[n, x] = [int(j) for j in sys.stdin.readline().split()]
a = [int(g) for g in sys.stdin.readline().split()]
if check(n, x, a):... | IMPORT FUNC_DEF FOR VAR FUNC_CALL VAR VAR IF VAR VAR VAR RETURN NUMBER RETURN NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN LIST VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR IF FUNC_CALL VAR VAR VAR VAR EX... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | T = int(input())
for _ in range(T):
n, x = map(int, input().split())
arr = list(map(int, input().split()))
if arr.count(x) == n:
print(0)
else:
my_list = []
for i in arr:
my_list.append(x - i)
if sum(my_list) == 0 or 0 in my_list:
print(1)
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR NUMBER ASSIGN VAR LIST FOR VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR VAR IF FUNC_CALL VAR V... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def solve():
n, x = map(int, input().split())
nums = list(map(int, input().split()))
nums.sort()
if nums[0] == nums[-1] and nums[0] == x:
print(0)
return
if sum(nums) == x * n:
print(1)
return
if x in nums:
print(1)
return
if nums.count(x) >= 2... | FUNC_DEF ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR IF VAR NUMBER VAR NUMBER VAR NUMBER VAR EXPR FUNC_CALL VAR NUMBER RETURN IF FUNC_CALL VAR VAR BIN_OP VAR VAR EXPR FUNC_CALL VAR NUMBER RETURN IF VAR VAR EXPR FUNC_CALL ... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | import sys
def inp():
return sys.stdin.readline().rstrip("\n").encode("utf8")
def mpint():
return map(int, sys.stdin.readline().split(" "))
def itg():
return int(sys.stdin.readline())
for __ in range(itg()):
n, x = mpint()
arr = tuple(mpint())
c = arr.count(x)
s = sum(arr)
if c =... | IMPORT FUNC_DEF RETURN FUNC_CALL FUNC_CALL FUNC_CALL VAR STRING STRING FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN ... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
for i in range(t):
n, x = [int(i) for i in input().split(" ")]
a = [int(i) for i in input().split(" ")]
infeteced = [(ai == x) for ai in a]
diff = [(0 if ai_infected else ai - x) for ai, ai_infected in zip(a, infeteced)]
if all(v == x for v in a):
print(0)
elif sum(diff)... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR VAR VAR VAR VAR ASSIGN VAR VAR NUMBER BIN_OP VAR VAR VAR VAR FUNC_CALL VAR VAR VAR IF FUNC_CALL VAR VAR VAR VAR ... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | import sys
for _ in range(int(input())):
n, x = map(int, sys.stdin.readline().split())
arr = list(map(int, sys.stdin.readline().split()))
flag = 0
f = sum(arr)
if f // n == x:
if f % n != 0:
flag = 2
else:
for i in range(n - 1):
if arr[i] != a... | IMPORT FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR IF BIN_OP VAR VAR VAR IF BIN_OP VAR VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR BIN_O... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for _ in range(int(input())):
n, x = map(int, input().split())
a = list(map(int, input().split()))
if a.count(x) == n:
print("0")
elif a.count(x) > 0:
print("1")
elif sum(a) // n == x and sum(a) % n == 0:
print("1")
else:
print("2") | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR STRING IF FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR STRING IF BIN_OP FUNC_CALL VAR VAR VAR VAR BIN_O... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | import sys
input = sys.stdin.readline
def inp():
return int(input())
def inlt():
return list(map(int, input().split()))
def insr():
s = input()
return list(s[: len(s) - 1])
def invr():
return map(int, input().split())
def fun(arr, n, x):
cnt = 0
sm = 0
for i in range(n):
... | IMPORT ASSIGN VAR VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR RETURN FUNC_CALL VAR VAR BIN_OP FUNC_CALL VAR VAR NUMBER FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF ASSIGN VAR NUMBER ASSIGN... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
for q in range(0, t):
n, x = map(int, input().split())
a = [int(i) for i in input().split()]
flag = 0
infect = 0
for i in range(0, n):
if a[i] != x:
flag = 1
else:
infect = 1
diff = [0] * n
for i in range(0, n):
diff[i] = x - a... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR IF VAR VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR BIN... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def solve(n, x, A):
l_val = 0
r_val = 0
already = 0
for i in range(n):
if A[i] > x:
r_val += A[i] - x
elif A[i] == x:
already += 1
else:
l_val += x - A[i]
if r_val == 0 and l_val == 0:
return 0
elif already > 0 or l_val == r_val... | FUNC_DEF ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR VAR VAR BIN_OP VAR VAR VAR IF VAR VAR VAR VAR NUMBER VAR BIN_OP VAR VAR VAR IF VAR NUMBER VAR NUMBER RETURN NUMBER IF VAR NUMBER VAR VAR RETURN NUMBER RETURN NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR ASSIGN... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for _ in range(int(input())):
n, k = map(int, input().split())
v = list(map(int, input().split()))
sum = 0
zero = 1
one = 0
for i in v:
if i != k:
zero = 0
else:
one = 1
sum += i - k
if zero:
print(0)
elif one or not sum:
pr... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER VAR BIN_OP VAR VAR IF VAR EXPR FU... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def solve(n, x, arr):
s = set(arr)
if len(list(s)) == 1:
if list(s)[0] == x:
return 0
else:
return 2
else:
if x in s:
return 1
sm = 0
for i in range(n):
sm += x - arr[i]
if sm == 0:
return 1
r... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR VAR IF FUNC_CALL VAR FUNC_CALL VAR VAR NUMBER IF FUNC_CALL VAR VAR NUMBER VAR RETURN NUMBER RETURN NUMBER IF VAR VAR RETURN NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR VAR BIN_OP VAR VAR VAR IF VAR NUMBER RETURN NUMBER RETURN NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
w = []
for i in range(t):
n, x = input().split()
x = int(x)
n = int(n)
r = list(map(int, input().split()))
boo = True
for i in r:
if i != x:
boo = False
break
if boo == True:
w.append(0)
else:
ras = 0
for i in r:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR ASSIGN VAR NUMBER IF VAR NUMBER EX... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for _ in range(int(input())):
n, x = map(int, input().split())
arr = list(map(int, input().split()))
ls = [0] * n
a = 0
b = 0
for i in range(n):
var = x - arr[i]
ls[i] = var
if var < 0:
a += var
else:
b += var
if a == 0 and b == 0:
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP VAR VAR VAR ASSIGN VAR VAR VAR I... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | from sys import stdin
input = stdin.readline
for _ in range(int(input())):
n, x = map(int, input().split())
(*a,) = map(int, input().split())
if a.count(x) == n:
print(0)
elif sum(x - i for i in a) == 0 or a.count(x):
print(1)
else:
print(2) | ASSIGN VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR NUMBER IF FUNC_CALL VAR BIN_OP VAR VAR VAR VAR NUMBER FUNC_CALL VAR VAR EXPR FUNC_CALL VAR NUMBER EXP... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
for i in range(t):
[n, x] = input().split()
n = int(n)
x = int(x)
a = input().split()
a = [int(k) for k in a]
if all(k == x for k in a):
print(0)
elif any(k == x for k in a):
print(1)
elif sum(a) == n * x:
print(1)
else:
print(2) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN LIST VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR VAR IF FUNC_CALL VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR NUMBER IF FUNC_CALL VAR VAR V... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | from sys import gettrace, stdin
if gettrace():
inputi = input
else:
def input():
return next(stdin)[:-1]
def inputi():
return stdin.buffer.readline()
def solve():
n, x = map(int, inputi().split())
aa = [int(a) for a in inputi().split()]
ic = aa.count(x)
if ic == n:
... | IF FUNC_CALL VAR ASSIGN VAR VAR FUNC_DEF RETURN FUNC_CALL VAR VAR NUMBER FUNC_DEF RETURN FUNC_CALL VAR FUNC_DEF ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR IF VAR VAR EXPR FUNC_CALL VAR NUMBER RETURN ASSIGN VAR FUNC_CALL ... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for _ in range(int(input())):
n, x = [int(c) for c in input().split()]
arr = [int(c) for c in input().split()]
ans = [(x - i) for i in arr]
if ans.count(0) == len(ans):
print(0)
elif sum(ans) == 0:
print(1)
elif arr.count(x) >= 1:
print(1)
else:
print(2) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP VAR VAR VAR VAR IF FUNC_CALL VAR NUMBER FUNC_CALL VAR VAR EXPR FUNC_CALL VAR NUMBER IF FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR NUM... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | import sys
readline = sys.stdin.readline
def inlt():
return list(map(int, readline().split()))
def ingen():
return map(int, readline().split())
def insr():
s = readline()
return list(s)
def inn():
return int(readline())
cases = inn()
for i in range(cases):
N, X = inlt()
scores = i... | IMPORT ASSIGN VAR VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR RETURN FUNC_CALL VAR VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
for _ in range(t):
n, x = [int(p) for p in input().split()]
arr = [int(p) for p in input().split()]
sm = 0
for i in range(len(arr)):
sm += x - arr[i]
if arr.count(x) == n:
print(0)
elif sm == 0 or x in arr:
print(1)
else:
print(2) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR BIN_OP VAR VAR VAR IF FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR NUMBER IF VA... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def Solve(data, y):
x = set(data)
if len(x) == 1 and y in x:
return 0
elif y in x:
return 1
elif sum(data) - len(data) * y == 0:
return 1
else:
return 2
def main():
t = int(input())
while t > 0:
t -= 1
n, x = map(int, input().split())
... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR NUMBER VAR VAR RETURN NUMBER IF VAR VAR RETURN NUMBER IF BIN_OP FUNC_CALL VAR VAR BIN_OP FUNC_CALL VAR VAR VAR NUMBER RETURN NUMBER RETURN NUMBER FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR NUMBER VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_C... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | import sys
def multiple_input():
return map(int, sys.stdin.readline().strip().split())
def list_input():
return list(map(int, sys.stdin.readline().strip().split()))
for _ in range(int(input())):
n, x = multiple_input()
a = list_input()
d = 0
flag1 = 1
flag2 = 0
for i in a:
... | IMPORT FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR V... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for i in range(int(input())):
n, k = map(int, input().split())
a = [int(i) for i in input().split()]
ans = 2
if sum(a) / n == k:
ans = 1
if k in a:
ans = 1
if len(set(a)) == 1:
if a[0] == k:
ans = 0
print(ans) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER IF BIN_OP FUNC_CALL VAR VAR VAR VAR ASSIGN VAR NUMBER IF VAR VAR ASSIGN VAR NUMBER IF FUNC_CALL VAR FUNC_CALL VAR VAR NUMBER IF VAR NUMBER... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | rw = int(input())
for wewq in range(rw):
n, x = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
t = False
for i in a:
if i % 2 == 0:
t = True
break
tt = 0
for i in range(n):
if a[i] == x:
tt += 1
ss = 0
ssn = ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR VAR IF BIN_OP VAR NUMBER NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL ... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def solve():
n, x = map(int, input().strip().split())
a = list(map(int, input().strip().split()))
s = 0
found_1 = 0
for i in a:
if i == x:
found_1 += 1
s += i
if found_1 == n:
print(0)
elif found_1 > 0 or s == x * n:
print(1)
else:
prin... | FUNC_DEF ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR VAR NUMBER VAR VAR IF VAR VAR EXPR FUNC_CALL VAR NUMBER IF VAR NUMBER VAR BIN_OP VAR VAR EXPR FUNC_CALL VAR ... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | import sys
input = sys.stdin.readline
def main():
n, x = map(int, input().split())
alst = list(map(int, input().split()))
if alst.count(x) == n:
print(0)
elif sum(alst) == x * n:
print(1)
elif x in alst:
print(1)
else:
print(2)
for _ in range(int(input())):
... | IMPORT ASSIGN VAR VAR FUNC_DEF ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR NUMBER IF FUNC_CALL VAR VAR BIN_OP VAR VAR EXPR FUNC_CALL VAR NUMBER IF VAR VAR EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL ... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def counter(n, x, ratings):
if set(ratings) == {x}:
return 0
count = ratings.count(x)
total = sum(ratings)
if count == 0:
if total - n * x == 0:
return 1
else:
return 1
return 2
t = int(input())
for _ in range(t):
n, x = map(int, input().split())
rat... | FUNC_DEF IF FUNC_CALL VAR VAR VAR RETURN NUMBER ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR IF VAR NUMBER IF BIN_OP VAR BIN_OP VAR VAR NUMBER RETURN NUMBER RETURN NUMBER RETURN NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for _ in range(int(input())):
n, x = map(int, input().split())
a = list(map(int, input().split()))
if x == a[0] and a.count(x) == n:
print(0)
continue
neg, pos = 0, 0
for i in a:
if i < x:
neg += x - i
else:
pos += i - x
if neg == pos or x ... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR NUMBER FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR NUMBER ASSIGN VAR VAR NUMBER NUMBER FOR VAR VAR IF VAR VAR VAR BIN_OP VAR VAR VAR BIN_O... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
buf = []
for _ in range(t):
n, x = map(int, input().split())
aaa = list(map(int, input().split()))
exists_same = False
exists_different = False
total = 0
for a in aaa:
a -= x
if a == 0:
exists_same = True
continue
exists_different ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR VAR VAR IF VAR NUMBER ASSIGN VAR NUMBER ASSIGN VA... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | import sys
input = sys.stdin.readline
for _ in range(int(input())):
n, x = map(int, input().split())
ar = list(map(int, input().split()))
flag = True
for i in ar:
if i != x:
flag = False
break
if flag:
print(0)
else:
su = 0
for i in ar:
... | IMPORT ASSIGN VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR ASSIGN VAR NUMBER IF VAR EXPR FUNC_CALL VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR VA... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | from sys import stdin, stdout
input = stdin.readline
print = lambda x: stdout.write(str(x) + "\n")
for _ in range(int(input())):
n, x = map(int, input().split())
a = list(map(int, input().split()))
left = 0
right = 0
neutral = 0
for i in a:
if i > x:
right += i - x
e... | ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR STRING FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR V... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def match(kj, accounts):
count = 0
for k in accounts:
if kj == k:
count += 1
return count
def average(accounts):
return sum(accounts) / len(accounts)
def solve(n, kj, accounts):
match_count = match(kj, accounts)
avg = average(accounts)
if match_count == n:
ret... | FUNC_DEF ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR VAR NUMBER RETURN VAR FUNC_DEF RETURN BIN_OP FUNC_CALL VAR VAR FUNC_CALL VAR VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR IF VAR VAR RETURN NUMBER IF VAR NUMBER RETURN NUMBER IF VAR VAR RETURN NUMBER RETURN NUMBER ASSIGN VAR FUNC_CALL VAR F... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
n, x = map(int, input().split())
rate = list(map(int, input().split()))
for j in range(n):
rate[j] -= x
if sum(rate) == 0:
flg = 0
for k in range(n):
if rate[k] != 0:
flg = 1
... | IMPORT ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR VAR VAR VAR IF FUNC_CALL VAR VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for i in range(int(input())):
n, x = map(int, input().split())
ls = [int(a) for a in input().split()]
ls.sort()
x1 = ls.count(x)
if x1 == n:
print(0)
elif x1 >= n / 2:
print(1)
elif x1 > 0:
print(1)
elif sum(ls) / len(ls) == x:
print(1)
else:
p... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR IF VAR VAR EXPR FUNC_CALL VAR NUMBER IF VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR NUMBER IF VAR NUMBER EXPR F... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for _ in range(int(input())):
n, m = [int(i) for i in input().split()]
lst = [int(i) for i in input().split()]
d, k = 0, 0
for i in range(n):
d += m - lst[i]
if lst[i] == m:
k += 1
if d == 0:
print(0 if k == n else 1)
else:
print(1 if k >= 1 else 2) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR VAR VAR BIN_OP VAR VAR VAR IF VAR VAR VAR VAR NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR VAR VAR NUMBER ... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for _ in range(int(input())):
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
s = 0
q = list(set(a))
if len(q) == 1 and q[0] == k:
print("0")
elif sum(a) / n == k or k in a:
print("1")
else:
print("2") | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR NUMBER VAR NUMBER VAR EXPR FUNC_CALL VAR STRING IF... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | import sys
sys.setrecursionlimit(10**5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II():
return int(sys.stdin.readline())
def MI():
return map(int, sys.stdin.readline().split())
def LI():
return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number):
return [... | IMPORT EXPR FUNC_CALL VAR BIN_OP NUMBER NUMBER ASSIGN VAR BIN_OP FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR STRING FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def solve():
n, x = map(int, input().split())
al = list(map(int, input().split()))
ok = True
for i in al:
if i != x:
ok = False
if ok:
print(0)
return
s = 0
inf = False
for i in al:
s += x - i
if i == x:
inf = True
if s ... | FUNC_DEF ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR ASSIGN VAR NUMBER IF VAR EXPR FUNC_CALL VAR NUMBER RETURN ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR VAR BIN_OP VAR VAR IF VAR VAR ASSIGN VAR... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
def solve(n, x, a):
if all(x == a[i] for i in range(n)):
return 0
if sum(a) == n * x:
return 1
if any(x == a[i] for i in range(n)):
return 1
else:
return 2
for _ in range(t):
n, x = map(int, input().split())
a = list(map(int, input().split()))... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF IF FUNC_CALL VAR VAR VAR VAR VAR FUNC_CALL VAR VAR RETURN NUMBER IF FUNC_CALL VAR VAR BIN_OP VAR VAR RETURN NUMBER IF FUNC_CALL VAR VAR VAR VAR VAR FUNC_CALL VAR VAR RETURN NUMBER RETURN NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
for q in range(t):
n, x = map(int, input().split())
mass = list()
flag = False
for i in input().split():
y = int(i)
if y == x:
n -= 1
else:
mass.append(y)
if y == x:
flag = True
if n == 0:
print(0)
elif ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR IF VAR VAR VAR NUMBER EXPR FUNC_CALL VAR VAR IF VAR VAR ASSIGN VAR NUMBER IF VAR NUMBER EXPR F... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | test = int(input())
for i in range(test):
n, x = [int(x) for x in input().split(" ")]
a = [int(x) for x in input().split(" ")]
count = 0
for i in range(n):
if a[i] == x:
count += 1
if count == n:
print(0)
elif count == 0:
s = 0
for i in range(n):
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR VAR VAR NUMBER IF VAR VAR EXPR FUNC_CALL VAR NUMBER IF VAR NUMBER AS... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
while t:
t -= 1
i = input().split()
n = int(i[0])
x = int(i[1])
arr = input().split()
flag = 0
sum = 0
for i in arr:
i = int(i)
sum += i
if i == x:
flag = 1
if not flag:
if x * n == sum:
print(1)
else:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR VAR NUMBER ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR VAR IF VAR VAR ASSIGN VAR NUMBER IF V... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def ans(a, n, k):
same = 0
for i in a:
if i == k:
same += 1
if same == n:
return 0
if sum(a) % n == 0 and sum(a) // n == k:
return 1
if same > 0:
return 1
return 2
m = int(input())
for i in range(m):
brr = input().split()
n = int(brr[0])
... | FUNC_DEF ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR VAR NUMBER IF VAR VAR RETURN NUMBER IF BIN_OP FUNC_CALL VAR VAR VAR NUMBER BIN_OP FUNC_CALL VAR VAR VAR VAR RETURN NUMBER IF VAR NUMBER RETURN NUMBER RETURN NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for _ in range(int(input())):
n, x = map(int, input().split())
c = 0
su = 0
for i in list(map(int, input().split())):
if i == x:
c += 1
su += x - i
if c == n:
print(0)
elif c == 0 and su != 0:
print(2)
else:
print(1) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR VAR NUMBER VAR BIN_OP VAR VAR IF VAR VAR EXPR FUNC_CALL VAR NUMBER IF VAR NUMBER VAR NUMBER EXPR FUNC_... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for query in range(int(input())):
nx = input().split()
n = int(nx[0])
x = int(nx[1])
a = [int(x) for x in input().split()]
b = 0
for y in range(n):
if a[y] == x:
b += 1
if b == n:
print(0)
continue
if b >= 1 or sum(a) == n * x:
print(1)
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR VAR VAR NUMBER IF VAR VAR EXPR FUNC_CALL VAR NUMBER... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def solve(a, x):
if [x] * len(a) == a:
return 0
if x in a or sum(a) == x * len(a):
return 1
return 2
tc = int(input())
for _ in range(tc):
n, x = map(int, input().split())
a = list(map(int, input().split()))
print(solve(a, x)) | FUNC_DEF IF BIN_OP LIST VAR FUNC_CALL VAR VAR VAR RETURN NUMBER IF VAR VAR FUNC_CALL VAR VAR BIN_OP VAR FUNC_CALL VAR VAR RETURN NUMBER RETURN NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def solve(n, k, rs):
rating_ne = []
for rate in rs:
if rate != k:
rating_ne.append(rate)
if not rating_ne:
return 0
if sum(rating_ne) == k * len(rating_ne) or n > len(rating_ne):
return 1
return 2
N = int(input())
for i in range(N):
nc, killjoy = list(map(in... | FUNC_DEF ASSIGN VAR LIST FOR VAR VAR IF VAR VAR EXPR FUNC_CALL VAR VAR IF VAR RETURN NUMBER IF FUNC_CALL VAR VAR BIN_OP VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR RETURN NUMBER RETURN NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_C... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for _ in range(int(input())):
n, x = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
acc = 0
res = 0
changed = False
detector = False
for i in range(n):
acc += x - a[i]
if x - a[i] == 0:
detector = True
a[i] = x
if acc != 0:... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR VAR BIN_OP VAR VAR VAR IF BIN_OP VAR VAR VAR NUMBER AS... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def solve(ratings, n, r):
if ratings.count(r) == n:
print(0)
elif ratings.count(r) > 0:
print(1)
elif sum(ratings) == r * n:
print(1)
else:
print(2)
def main():
t = int(input())
for i in range(t):
n, r = list(map(int, input().split()))
solve(list... | FUNC_DEF IF FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR NUMBER IF FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR NUMBER IF FUNC_CALL VAR VAR BIN_OP VAR VAR EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR NUMBER FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR V... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
for i in range(0, t):
a, b = map(int, input().split())
arr = list(map(int, input().strip().split()))[:a]
ct = 0
summ = 0
for j in arr:
if j == b:
ct += 1
summ = summ + (j - b)
if ct == a:
ans = 0
elif summ == 0 or ct > 0:
ans = 1
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR VAR NUMBER ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR IF ... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def solve(a, b, d):
big = float("inf")
small = float("-inf")
diff = 0
same = 0
for i in range(a):
if d[i] != b:
same += 1
if i < a - 1:
if d[i] > b:
diff -= b - d[i]
else:
diff += d[i] - b
if same == 0:
r... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR VAR VAR NUMBER IF VAR BIN_OP VAR NUMBER IF VAR VAR VAR VAR BIN_OP VAR VAR VAR VAR BIN_OP VAR VAR VAR IF VAR NUMBER RETURN NUMBER IF VAR VAR RETURN NUMBER RETURN BIN_OP VAR NU... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def voiD():
a, b = 1, 1
if a == b:
return 0
return 1
for _ in range(int(input())):
n, x = map(int, input().split())
l = [int(j) for j in input().split()]
p = 0
n = 0
o = False
for i in l:
if i > x:
p += i - x
elif i < x:
n += x - i
... | FUNC_DEF ASSIGN VAR VAR NUMBER NUMBER IF VAR VAR RETURN NUMBER RETURN NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR VA... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
while t:
n, x = map(int, input().split())
a = list(map(int, input().split()))
if a == [x] * n:
print(0)
elif sum(a) - n * x == 0:
print(1)
else:
flag = 0
for y in range(n):
if a[y] == x:
flag = 1
break
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR BIN_OP LIST VAR VAR EXPR FUNC_CALL VAR NUMBER IF BIN_OP FUNC_CALL VAR VAR BIN_OP VAR VAR NUMBER EXPR FUNC_CALL VAR NUMBER ASSIGN VAR NUMBER ... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for _ in range(int(input())):
n, x = map(int, input().split())
a = list(map(int, input().split()))
eq = pos = neg = ans = 0
for i in a:
if i < x:
neg += x - i
elif i > x:
pos += i - x
else:
eq += 1
if pos or neg:
if pos == neg:
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR VAR VAR NUMBER FOR VAR VAR IF VAR VAR VAR BIN_OP VAR VAR IF VAR VAR VAR BIN_OP VAR VAR VAR NUMBER IF VAR VAR IF VAR VAR ASSIGN VAR ... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | T = int(input())
for Tid in range(T):
n, x = map(int, input().split())
s = -1 * n * x
a = list(map(int, input().split()))
flag = 1
flag1 = 0
for i in range(n):
if a[i] != x:
flag = 0
else:
flag1 = 1
s = s + a[i]
if flag:
print(0)
el... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP NUMBER VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR VAR ASSIGN VAR NUM... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def inp():
return int(input())
def inlt():
return list(map(int, input().split()))
def insr():
s = input()
return list(s[: len(s) - 1])
def invr():
return map(int, input().split())
t = inp()
for _ in range(t):
x = inlt()[1]
accts = inlt()
s = set(accts)
if x in s:
if l... | FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR RETURN FUNC_CALL VAR VAR BIN_OP FUNC_CALL VAR VAR NUMBER FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSI... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def solve():
n, x = map(int, input().split())
lst = list(map(int, input().split()))
sum = 0
b = 0
for i in lst:
if i == x:
b += 1
sum += i
if b == n:
print(0)
return 0
if b >= 1:
print(1)
return 0
if sum == x * n:
print(... | FUNC_DEF ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR VAR NUMBER VAR VAR IF VAR VAR EXPR FUNC_CALL VAR NUMBER RETURN NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER RETURN NUMBER IF V... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def iinput():
return int(input())
def finput():
return float(input())
def linput():
return [int(_) for _ in input().split()]
T = iinput()
for _ in range(T):
n, x = linput()
a = linput()
pos, neg = 0, 0
flag = False
for i in a:
if i > x:
pos += i - x
elif... | FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR VAR NUMBER NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
ans = []
for i in range(0, t):
cnt = 0
d = 0
n, x = input().split()
n = int(n)
x = int(x)
a = input().split()
for i in range(0, n):
a[i] = int(a[i])
for i in range(0, n):
d = d + a[i] - x
if a[i] == x:
cnt += 1
if cnt == n:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR VAR FUNC_CALL VAR VA... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
while t:
t -= 1
n, x = map(int, input().split())
a = [int(i) for i in input().split()]
if a.count(x):
if a.count(x) == n:
print(0)
else:
print(1)
else:
b = list(set(a))
s = 0
for i in b:
s += a.count(i) * (i... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR IF FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR ASSIG... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | from sys import stdin, stdout
def mark(A, B, K):
for i in range(len(A)):
if A[i] == K:
A[i] = 1
def solve():
N, K = list(map(int, stdin.readline().split()))
arr = list(map(int, stdin.readline().split()))
if arr.count(K) == N:
return 0
if K in arr:
return 1
... | FUNC_DEF FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR VAR ASSIGN VAR VAR NUMBER FUNC_DEF ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF FUNC_CALL VAR VAR VAR RETURN NUMBER IF VAR VAR RETURN NUMBER ASSIGN VAR NUMBER FOR V... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def kill(arr, k):
ans = 0
for i in arr:
ans += k - i
if arr.count(k) == len(arr):
return 0
if ans == 0:
return 1
if arr.count(k) >= 1:
return 1
return 2
for i in range(int(input())):
a, b = map(int, input().strip().split())
lst = list(map(int, input().st... | FUNC_DEF ASSIGN VAR NUMBER FOR VAR VAR VAR BIN_OP VAR VAR IF FUNC_CALL VAR VAR FUNC_CALL VAR VAR RETURN NUMBER IF VAR NUMBER RETURN NUMBER IF FUNC_CALL VAR VAR NUMBER RETURN NUMBER RETURN NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR ASSIGN V... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
for _ in range(t):
n, x = map(int, input().split())
a = list(map(int, input().split()))
b = True
for i in range(n):
if a[i] != x:
b = False
break
if b:
print(0)
else:
for i in range(n):
if a[i] == x or sum(a) == n * x:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR VAR ASSIGN VAR NUMBER IF VAR EXPR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | o = int(input())
for i in range(0, o):
p = list(map(int, input().split()))
n = list(map(int, input().split()))
h = []
y = 0
for j in range(0, p[0]):
h.append(n[j] - p[1])
for j in range(0, len(h)):
if h[j] != 0:
y = 1
if y == 1 and 0 in h:
y = 2
if sum... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VAR VAR VAR NU... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
for _ in range(t):
n, x = map(int, input().split())
arr = [int(j) for j in input().split()]
c = arr.count(x)
if c == n:
print(0)
continue
elif c > 0:
print(1)
continue
net = 0
for i in range(n):
net += arr[i] - x
if net == 0:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR IF VAR VAR EXPR FUNC_CALL VAR NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
for _ in range(t):
n, x = map(int, input().split())
tempA = [int(val) for val in input().split()]
a = [val for val in tempA if val != x]
if len(a) != n and len(a) != 0:
print(1)
else:
result = 0
if len(a) == 1:
result += 1
elif len(a) > 1:... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR VAR VAR VAR VAR IF FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR NUMBER ASSIGN VAR NUMBER IF FUNC_CALL VAR... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
n = []
x = []
a = []
for i in range(t):
ni, xi = map(int, input().split())
k = list(map(int, input().split()))
n.append(ni)
x.append(xi)
a.append(k)
def fun(n, x, a):
su = 0
flag = 1
nom = 0
for i in range(n):
su += a[i] - x
if a[i] != x:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR LIST ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR FUNC_DEF ASSIG... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def process():
n, x = list(map(int, input().split()))
a = list(map(int, input().split()))
nz = 1
atl_0 = 0
for i in range(n):
a[i] = a[i] - x
if a[i] != 0:
nz = 0
if a[i] == 0:
atl_0 = 1
if nz == 1:
print(0)
return
if sum(a) == ... | FUNC_DEF ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR BIN_OP VAR VAR VAR IF VAR VAR NUMBER ASSIGN VAR NUMBER IF VAR VAR NUMBER ASSIGN VAR NUMBER IF VA... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | for _ in " " * int(input()):
n, k = map(int, input().split())
a = [int(x) for x in input().split()]
print(0 if all([(i == k) for i in a]) else 1 if sum(a) == k * n or k in a else 2) | FOR VAR BIN_OP STRING FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR VAR VAR NUMBER FUNC_CALL VAR VAR BIN_OP VAR VAR VAR VAR NUMBER NUMBER |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
for i in range(t):
n, k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
x = sum(a)
if a.count(k) == n:
print(0)
elif a.count(k) < n and a.count(k) > 0:
print(1)
elif x - k * n == 0:
print(1)
else:
print(2) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR NUMBER IF FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR NUMBER EXPR FU... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input(""))
bal = []
arr = []
for i in range(t):
bal.append(list(map(int, input().split())))
arr.append(list(map(int, input().split())))
for i in range(t):
b = bal[i]
a = arr[i]
a.sort()
n = b[0]
x = b[1]
dp = a.copy()
for j in range(n):
dp[j] = dp[j] - x
if a.coun... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR STRING ASSIGN VAR LIST ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR VAR EX... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
for _ in range(t):
n, x = list(map(int, input().split(" ")))
ratings = list(map(int, input().split(" ")))
f = 0
for i in ratings:
if i != x:
f = 1
if f == 0:
print(0)
continue
diff = 0
same_rating = False
for i in ratings:
diff... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR ASSIGN VAR NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER ASSI... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def cont_req(x, ns):
diff = 0
diff_exists = False
same_exists = False
for n in ns:
if n != x:
diff_exists = True
else:
same_exists = True
diff += n - x
if diff == 0 and not diff_exists:
return 0
elif diff != 0 and not same_exists:
r... | FUNC_DEF ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER VAR BIN_OP VAR VAR IF VAR NUMBER VAR RETURN NUMBER IF VAR NUMBER VAR RETURN NUMBER RETURN NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUN... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
for i in range(t):
n, x = map(int, input().split())
arr = [int(x) for x in input().split()]
s = set(arr)
if len(s) == 1 and arr[0] == x:
print(0)
continue
flag = False
s = 0
for i in arr:
s = s + (i - x)
if i == x:
flag = True
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR NUMBER VAR NUMBER VAR EXPR FUNC_CALL VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | import sys
input = iter(sys.stdin.read().splitlines()).__next__
def solve(n, x, a):
num_equal_x = a.count(x)
if num_equal_x == n:
return 0
elif num_equal_x > 0:
return 1
elif sum(a) == x * n:
return 1
return 2
t = int(input())
output = []
for _ in range(t):
n, x = ma... | IMPORT ASSIGN VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR VAR IF VAR VAR RETURN NUMBER IF VAR NUMBER RETURN NUMBER IF FUNC_CALL VAR VAR BIN_OP VAR VAR RETURN NUMBER RETURN NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
for i in range(t):
n, x = map(int, input().split())
a = list(map(int, input().split()))
if len(set(a)) == 1 and a[0] == x:
print(0)
elif sum(a) // n == sum(a) / n and sum(a) // n == x:
print(1)
elif a.count(x) > 0:
print(1)
else:
print(2) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF FUNC_CALL VAR FUNC_CALL VAR VAR NUMBER VAR NUMBER VAR EXPR FUNC_CALL VAR NUMBER IF BIN_OP FUNC_CALL VAR VAR VAR BIN_OP FUNC_CALL... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | t = int(input())
for _ in range(t):
n, x = map(int, input().split())
a = list(map(int, input().split()))
c = a.count(x)
if sum(a) == n * x:
if c == n:
print(0)
else:
print(1)
elif sum(a) % n == 0:
if c >= 1:
print(1)
else:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR BIN_OP VAR VAR IF VAR VAR EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR NUMBER IF ... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | N = int(input())
for _ in range(N):
n, x = list(map(int, input().split()))
acs = []
a = 0
left = 0
for y in list(map(int, input().split())):
if y != x:
left += y - x
acs.append(y)
else:
a |= 1
if not acs:
print(0)
continue
i... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR VAR BIN_OP VAR VAR EXPR FUNC_CALL VAR VAR VAR NUMBER IF V... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | test = int(input())
for t in range(0, test):
n, x = [int(i) for i in input().split(" ")]
a = [int(i) for i in input().split(" ")]
u = []
for e in a:
if e != x:
u.append(e)
if len(u) == 0:
print(0)
continue
if len(u) != n:
print(1)
continue
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR LIST FOR VAR VAR IF VAR VAR EXPR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR NUMBER ... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
t = int(input())
for _ in range(t):
n, x = map(int, input().split())
a = list(map(int, input().split()))
if all([(x == ae) for ae in a]):
print(0)
elif sum(a) / n == x:
print(1... | IMPORT ASSIGN VAR VAR ASSIGN VAR VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF FUNC_CALL VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR NUMBER IF BIN_OP FUNC_CALL VAR VA... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def solve():
n, x = map(int, input().split())
a = list(map(int, input().split()))
if all(i == x for i in a):
print(0)
else:
average = sum(a) / n
if x == average or x in a:
print(1)
else:
print(2)
runs = int(input())
while runs > 0:
solve()
... | FUNC_DEF ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF FUNC_CALL VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR NUMBER ASSIGN VAR BIN_OP FUNC_CALL VAR VAR VAR IF VAR VAR VAR VAR EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_C... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def get_int():
return int(input())
def get_ints():
return [int(x) for x in input().split()]
for t in range(0, get_int()):
n, y = get_ints()
accounts = get_ints()
s = sum(accounts)
if y in accounts and len(set(accounts)) == 1:
print(0)
continue
if y in accounts or n * y ==... | FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR IF VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR NUMBER IF VAR VAR B... |
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).
Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu... | def inp():
return int(input())
def inlt():
return list(map(int, input().split()))
def insr():
s = input()
return list(s[: len(s)])
def invr():
return map(int, input().split())
n = inp()
for i in range(n):
l = inlt()
m = l[0]
killjoy = l[1]
l = inlt()
same = 0
accul = ... | FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR RETURN FUNC_CALL VAR VAR FUNC_CALL VAR VAR FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CA... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.