problem_id stringlengths 6 6 | buggy_code stringlengths 8 526k | fixed_code stringlengths 12 526k | labels listlengths 0 15 ⌀ | buggy_submission_id int64 1 1.54M | fixed_submission_id int64 2 1.54M | user_id stringlengths 10 10 | language stringclasses 8
values |
|---|---|---|---|---|---|---|---|
p02761 | N, M = map(int, input().split())
guess = [-1] * N
for i in range(M):
s, c = map(int, input().split())
s = s - 1
if s == 0 and c == 0 and M>1:
print(-1)
exit()
if guess[s] == -1:
guess[s] = c
elif guess[s] == c:
continue
else:
print(-1)
exit()
if len(guess) > 1 and guess[0] == -1:
... | N, M = map(int, input().split())
guess = [-1] * N
for i in range(M):
s, c = map(int, input().split())
s = s - 1
if s == 0 and c == 0 and N>1:
print(-1)
exit()
if guess[s] == -1:
guess[s] = c
elif guess[s] == c:
continue
else:
print(-1)
exit()
if len(guess) > 1 and guess[0] == -1:
... | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 549,955 | 549,956 | u074687136 | python |
p02761 | import sys
input = sys.stdin.readline
N,M=map(int,input().split())
score=[-1]*N
for i in range(M):
s,c=map(int,input().split())
s-=1
if score[s]==-1 or score[s]==c:
score[s]=c
else:
print(-1)
sys.exit()
if N>1 and score[0]==0:
print(-1)
sys.exit()
for i in range... | import sys
input = sys.stdin.readline
N,M=map(int,input().split())
score=[-1]*N
for i in range(M):
s,c=map(int,input().split())
s-=1
if score[s]==-1 or score[s]==c:
score[s]=c
else:
print(-1)
sys.exit()
if N>1 and score[0]==0:
print(-1)
sys.exit()
for i in range... | [
"call.remove",
"control_flow.branch.if.condition.change"
] | 549,958 | 549,959 | u695811449 | python |
p02761 | import sys
N,M=map(int,input().split())
if M==0:
if N==1:
ans=0
else:
ans=10**(N-1)
print(ans)
sys.exit()
listSC=[]
for k in range(M):
s,c=map(int,input().split())
listSC+=[[s,c]]
MAX=0
if N==1:
for s,c in listSC:
MAX==max(MAX,c)
if MAX==0:
print(0)
sys.exit()
for i in rang... | import sys
N,M=map(int,input().split())
if M==0:
if N==1:
ans=0
else:
ans=10**(N-1)
print(ans)
sys.exit()
listSC=[]
for k in range(M):
s,c=map(int,input().split())
listSC+=[[s,c]]
MAX=0
if N==1:
for s,c in listSC:
MAX=max(MAX,c)
if MAX==0:
print(0)
sys.exit()
for i in range... | [
"expression.operation.compare.replace.remove",
"assignment.replace.add",
"misc.typo"
] | 549,972 | 549,973 | u829249049 | python |
p02761 | n, m = list(map(int, input().split()))
sc = [list(map(int,input().split())) for i in range(m)]
for i in range(0, 10**n):
str_i = str(i)
if len(str_i) != n: continue
chk = True
for s, c in sc:
cnt &= str_i[s-1] == str(c)
if chk:
print(i)
exit()
print(-1)
| n, m = list(map(int, input().split()))
sc = [list(map(int,input().split())) for i in range(m)]
for i in range(0, 10**n):
str_i = str(i)
if len(str_i) != n: continue
chk = True
for s, c in sc:
chk &= str_i[s-1] == str(c)
if chk:
print(i)
exit()
print(-1)
| [
"identifier.change"
] | 549,976 | 549,977 | u057993957 | python |
p02761 | N,M = map(int,input().split())
m = []
for i in range(M):
m.append(list(map(int,input().split())))
for i in range(10**N):
a = str(i)
if i >= 10**(N-1):
for j in range(M):
try:
if a[m[j][0]-1] == str(m[j][1]):
True
... | N,M = map(int,input().split())
m = []
for i in range(M):
m.append(list(map(int,input().split())))
for i in range(10**N):
a = str(i)
if i >= 10**(N-1):
for j in range(M):
try:
if a[m[j][0]-1] == str(m[j][1]):
True
... | [
"call.add",
"call.arguments.change"
] | 549,991 | 549,992 | u093783313 | python |
p02761 | import sys
N, M = map(int, input().split())
num_map = [None for _ in range(N)]
for _ in range(M):
s, c = map(int, input().split())
s -= 1
if s > N or (num_map[s] is not None and num_map[s] != c) or (s == 0 and c == 0 and N > 1):
print(-1)
sys.exit()
num_map[s] = c
num_map.reverse()
ans... | import sys
N, M = map(int, input().split())
num_map = [None for _ in range(N)]
for _ in range(M):
s, c = map(int, input().split())
s -= 1
if s > N or (num_map[s] is not None and num_map[s] != c) or (s == 0 and c == 0 and N > 1):
print(-1)
sys.exit()
num_map[s] = c
num_map.reverse()
ans... | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove"
] | 549,993 | 549,994 | u538632589 | python |
p02761 | n,m = map(int,input().split())
s_li=[0]*m
l_li=[0]*m
for i in range(m):
s_li[i],l_li[i] = map(int,input().split())
for i in range(1,1000):
string = str(i)
if len(string)!=n:
continue
flag=True
for j in range(m):
if int(string[s_li[j]-1])==l_li[j]:
continue
flag=... | n,m = map(int,input().split())
s_li=[0]*m
l_li=[0]*m
for i in range(m):
s_li[i],l_li[i] = map(int,input().split())
for i in range(1000):
string = str(i)
if len(string)!=n:
continue
flag=True
for j in range(m):
if int(string[s_li[j]-1])==l_li[j]:
continue
flag=Fa... | [
"call.arguments.change"
] | 550,012 | 550,013 | u535171899 | python |
p02761 | n, m = map(int, input().split())
a = [[],[],[]]
for i in range(m):
s, c = map(int, input().split())
if not c in a[s-1]:
a[s-1].append(c)
ans = 0
if m==0:
if n==3:
print(100)
elif n==2:
print(10)
else :
print(0)
elif (len(a[0]) > 1) or (len(a[1]) > 1) or (len(a[... | n, m = map(int, input().split())
a = [[],[],[]]
for i in range(m):
s, c = map(int, input().split())
if not c in a[s-1]:
a[s-1].append(c)
ans = 0
if m==0:
if n==3:
print(100)
elif n==2:
print(10)
else :
print(0)
elif (len(a[0]) > 1) or (len(a[1]) > 1) or (len(a[... | [
"call.arguments.change"
] | 550,045 | 550,046 | u235027735 | python |
p02761 | N,M = map(int,input().split())
sc = [tuple(map(int,input().split())) for i in range(M)]
if N==1:
r = range(1,10)
elif N==2:
r = range(10,100)
else:
r = range(100,1000)
for n in r:
n = str(n)
for s,c in sc:
s -= 1
if n[s] != str(c):
break
else:
print(n)
... | N,M = map(int,input().split())
sc = [tuple(map(int,input().split())) for i in range(M)]
if N==1:
r = range(0,10)
elif N==2:
r = range(10,100)
else:
r = range(100,1000)
for n in r:
n = str(n)
for s,c in sc:
s -= 1
if n[s] != str(c):
break
else:
print(n)
... | [
"literal.number.integer.change",
"assignment.value.change",
"call.arguments.change",
"control_flow.loop.range.bounds.lower.change"
] | 550,063 | 550,064 | u028014940 | python |
p02761 | n, m = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(m)]
ans = -1
for i in range(10 ** n):
tmp = str(i)
if len(tmp) == n:
flg = False
for l in lst:
if tmp[l[0] - 1] == str(l[1]):
flg = True
break
if flg == Tru... | n, m = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(m)]
ans = -1
for i in range(10 ** n):
tmp = str(i)
if len(tmp) == n:
flg = True
for l in lst:
if tmp[l[0] - 1] != str(l[1]):
flg = False
break
if flg == True... | [
"misc.opposites",
"assignment.value.change",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 550,067 | 550,068 | u731322489 | python |
p02761 | def main():
N, M = map(int, input().split())
num = [-1] * N
for _ in range(M):
s, c = map(int, input().split())
s -= 1
if s == 0 and c == 0:
if N != 1:
print(-1)
return
if num[s] == -1:
num[s] = c
elif num[s] != c:
print(-1)
return
ans = ""
for i i... | def main():
N, M = map(int, input().split())
num = [-1] * N
for _ in range(M):
s, c = map(int, input().split())
s -= 1
if s == 0 and c == 0:
if N != 1:
print(-1)
return
if num[s] == -1:
num[s] = c
elif num[s] != c:
print(-1)
return
ans = ""
for i i... | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 550,096 | 550,097 | u720721463 | python |
p02761 | N, M = list(map(int, input().split()))
sc = []
for i in range(M):
s, c = list(map(int, input().split()))
sc.append([s, c])
print(sc)
for i in range(10**N):
stri = str(i)
if len(stri) == N:
for j in range(M):
k = sc[j][0]
if not stri[k-1] == str(sc[j][1]):
break
else:
print(i)
... | N, M = list(map(int, input().split()))
sc = []
for i in range(M):
s, c = list(map(int, input().split()))
sc.append([s, c])
for i in range(10**N):
stri = str(i)
if len(stri) == N:
for j in range(M):
k = sc[j][0]
if not stri[k-1] == str(sc[j][1]):
break
else:
print(i)
break... | [
"call.remove"
] | 550,100 | 550,101 | u752774573 | python |
p02761 | n, m = map(int, input().split())
number = [0] * n
cou = [0] * n
#logging.debug(number)#
for i in range(m):
s, c = map(int, input().split())
s -= 1
if cou[s] > 0 and c != number[s]:
print(-1)
exit()
else:
cou[s] += 1
number[s] = c
#logging.debug("number = {}, cou = {}... | n, m = map(int, input().split())
number = [0] * n
cou = [0] * n
#logging.debug(number)#
for i in range(m):
s, c = map(int, input().split())
s -= 1
if cou[s] > 0 and c != number[s]:
print(-1)
exit()
else:
cou[s] += 1
number[s] = c
#logging.debug("number = {}, cou = {}... | [
"literal.number.integer.change",
"assignment.variable.change",
"variable_access.subscript.index.change"
] | 550,106 | 550,107 | u620238824 | python |
p02761 |
N, M = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(M)]
cand = [-1] * N
flag = False
for s, c in X:
s -= 1
if cand[s] == -1:
cand[s] = c
elif cand[s] != c:
flag = True
if flag or (N > 1 and cand[0] == 0):
print(-1)
else:
ans = 0
for i in range(... |
N, M = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(M)]
cand = [-1] * N
flag = False
for s, c in X:
s -= 1
if cand[s] == -1:
cand[s] = c
elif cand[s] != c:
flag = True
if flag or (N > 1 and cand[0] == 0):
print(-1)
else:
ans = 0
for i in range(... | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 550,112 | 550,113 | u057109575 | python |
p02761 | #from statistics import median
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回
#
#
# pythonで無理なときは、pypyでやると正解するかも!!
#
#
mod = 10**9 + 7
def readInts():
return list(map(int,input().split()))
def main():
n,m = readInts()
S = []
for i in r... | #from statistics import median
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回
#
#
# pythonで無理なときは、pypyでやると正解するかも!!
#
#
mod = 10**9 + 7
def readInts():
return list(map(int,input().split()))
def main():
n,m = readInts()
S = []
for i in r... | [
"misc.typo",
"identifier.change",
"control_flow.branch.if.condition.change"
] | 550,142 | 550,143 | u156815136 | python |
p02761 | n, m = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(m)]
ans = [-1]*n
flag = False
for s, c in X:
if ans[s-1]>=0 and ans[s-1]!=c:
flag = False
if n > 1 and s == 1 and c == 0:
flag = False
else:
ans[s-1] = c
if flag:
print(-1)
exit(0)
for i ... | n, m = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(m)]
ans = [-1]*n
flag = False
for s, c in X:
if ans[s-1] >= 0 and ans[s-1] != c:
flag = True
if n > 1 and s == 1 and c == 0:
flag = True
else:
ans[s-1] = c
if flag:
print(-1)
exit(0)
for ... | [
"misc.opposites",
"assignment.value.change"
] | 550,159 | 550,160 | u441175813 | python |
p02761 | N, M = map(int, input().split())
s = []
c = []
for i in range(M):
si, ci = map(int, input().split())
s.append(si-1)
c.append(ci)
answer = [-1] * N
valid = True
for i in range(M):
if answer[s[i]] != -1 and answer[s[i]] != c[i]:
valid = False
break
answer[s[i]] = c[i]
if answer[0] ==... | N, M = map(int, input().split())
s = []
c = []
for i in range(M):
si, ci = map(int, input().split())
s.append(si-1)
c.append(ci)
answer = [-1] * N
valid = True
for i in range(M):
if answer[s[i]] != -1 and answer[s[i]] != c[i]:
valid = False
break
answer[s[i]] = c[i]
if answer[0] ==... | [
"expression.operation.compare.replace.remove",
"assignment.replace.add",
"misc.typo"
] | 550,161 | 550,162 | u850390157 | python |
p02761 | n,m = map(int,input().split())
l = [list(map(int,input().split())) for i in range(m)]
s,c = [list(i) for i in zip(*l)]
z = ['a'] * n
for i in range(m):
if z[s[i]-1] == 'a':
z[s[i]-1] = str(c[i])
elif z[s[i]-1] == str(c[i]):
pass
else:
print('-1')
exit(0)
if n == 1:
if z[0... | n,m = map(int,input().split())
if m != 0:
l = [list(map(int,input().split())) for i in range(m)]
s,c = [list(i) for i in zip(*l)]
z = ['a'] * n
for i in range(m):
if z[s[i]-1] == 'a':
z[s[i]-1] = str(c[i])
elif z[s[i]-1] == str(c[i]):
pass
else:
print('-1')
exit(0)
if... | [
"control_flow.branch.if.add"
] | 550,171 | 550,172 | u357751375 | python |
p02761 | from sys import stdin
import sys
import math
from functools import reduce
import itertools
n,m = [int(x) for x in stdin.readline().rstrip().split()]
x = list('a'*n)
for i in range(m):
a, b = [x for x in stdin.readline().rstrip().split()]
a = int(a) - 1
if x[a] == 'a' or x[a] == b:
x[a] = b
e... | from sys import stdin
import sys
import math
from functools import reduce
import itertools
n,m = [int(x) for x in stdin.readline().rstrip().split()]
x = list('a'*n)
for i in range(m):
a, b = [x for x in stdin.readline().rstrip().split()]
a = int(a) - 1
if x[a] == 'a' or x[a] == b:
x[a] = b
e... | [
"control_flow.branch.if.condition.change"
] | 550,183 | 550,184 | u788260274 | python |
p02761 | def main():
n, m = map(int, input().split())
C = [-1] * n
flag = 0
for i in range(m):
s, c = map(int, input().split())
if C[s - 1] == -1 or C[s - 1] == c:
C[s - 1] = c
else:
flag = 1
if flag or (C[0] == 0 and n != 0):
print(-1)
return
... | # def main():
# n, m = map(int, input().split())
# ans = [0] * n
# count = [0] * n
# for i in range(m):
# s, c = map(int, input().split())
# if s == 1 and c == 0 and n != 1:
# print(-1)
# exit()
# if count[s - 1] == 0 or ans[s - 1] == c:
# ans[... | [
"literal.number.integer.change",
"control_flow.branch.if.condition.change"
] | 550,189 | 550,190 | u279266699 | python |
p02761 | def main():
n, m = map(int, input().split())
ans = [0] * n
count = [0] * n
for i in range(m):
s, c = map(int, input().split())
if s == 1 and c == 0 and n != 1:
print(-1)
exit()
if count[s - 1] == 0 or ans[s - 1] == c:
ans[s - 1] = c
... | def main():
n, m = map(int, input().split())
ans = [0] * n
count = [0] * n
for i in range(m):
s, c = map(int, input().split())
if s == 1 and c == 0 and n != 1:
print(-1)
exit()
if count[s - 1] == 0 or ans[s - 1] == c:
ans[s - 1] = c
... | [
"control_flow.branch.if.condition.change"
] | 550,191 | 550,192 | u279266699 | python |
p02761 | def main():
n, m = map(int, input().split())
ans = [0] * n
count = [0] * n
for i in range(m):
s, c = map(int, input().split())
if s == 1 and c == 0 and n != 0:
print(-1)
exit()
if count[s - 1] == 0 or ans[s - 1] == c:
ans[s - 1] = c
... | def main():
n, m = map(int, input().split())
ans = [0] * n
count = [0] * n
for i in range(m):
s, c = map(int, input().split())
if s == 1 and c == 0 and n != 1:
print(-1)
exit()
if count[s - 1] == 0 or ans[s - 1] == c:
ans[s - 1] = c
... | [
"literal.number.integer.change",
"control_flow.branch.if.condition.change"
] | 550,193 | 550,192 | u279266699 | python |
p02761 | N,M = map(int, input().split())
dp = [-1] * N
for i in range(M):
s, c = map(int, input().split())
s -= 1
if dp[s] != -1 and dp[s] != c:
print(-1)
exit()
dp[s] = c
if N != 1:
if dp[0] == 0:
print(-1)
exit()
if dp[0] == -1:
dp[0] == 1
for i in range(... | N,M = map(int, input().split())
dp = [-1] * N
for i in range(M):
s, c = map(int, input().split())
s -= 1
if dp[s] != -1 and dp[s] != c:
print(-1)
exit()
dp[s] = c
if N != 1:
if dp[0] == 0:
print(-1)
exit()
if dp[0] == -1:
dp[0] = 1
for i in range(1... | [
"expression.operation.compare.replace.remove",
"assignment.replace.add",
"misc.typo"
] | 550,196 | 550,197 | u323859575 | python |
p02761 | N,M = map(int,input().split())
a = [0]*N
b = [None]*N
for i in range(M):
s,c = map(int,input().split())
if b[s-1] == c:
continue
else:
a[s-1] +=1
b[s-1] =c
count = 0
for i in range(N):
if a[i]>=2:
count=-1
elif b[0]==0 and N>1:
count =-1
elif b[i]==0:
if i is None:
if N==1... | N,M = map(int,input().split())
a = [0]*N
b = [None]*N
for i in range(M):
s,c = map(int,input().split())
if b[s-1] == c:
continue
else:
a[s-1] +=1
b[s-1] =c
count = 0
for i in range(N):
if a[i]>=2:
count=-1
elif b[0]==0 and N>1:
count =-1
elif i==0:
if b[i] is None:
if N==1... | [
"control_flow.loop.for.condition.change",
"control_flow.branch.if.condition.change"
] | 550,198 | 550,199 | u766646838 | python |
p02761 | N,M = map(int,input().split())
a = [0]*N
b = [None]*N
for i in range(M):
s,c = map(int,input().split())
if b[s-1] == c:
continue
else:
a[s-1] +=1
b[s-1] =c
count = 0
for i in range(N):
if a[i]>=2:
count=-1
elif b[0]==0 and N>1:
count =-1
elif i==0:
if i is None:
if N==1:
... | N,M = map(int,input().split())
a = [0]*N
b = [None]*N
for i in range(M):
s,c = map(int,input().split())
if b[s-1] == c:
continue
else:
a[s-1] +=1
b[s-1] =c
count = 0
for i in range(N):
if a[i]>=2:
count=-1
elif b[0]==0 and N>1:
count =-1
elif i==0:
if b[i] is None:
if N==1... | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 550,200 | 550,199 | u766646838 | python |
p02761 | n, m = map(int, input().split())
ans = [-1] * n
for _ in range(m):
s, c = map(int, input().split())
if ans[s - 1] == -1:
ans[s - 1] = c
elif ans[s - 1] != -1 and ans[s - 1] != c:
print(-1)
exit()
if n != 1 and ans[0] == 0:
print(-1)
exit()
if ans[0] == -1:
ans[0] = 1
... | n, m = map(int, input().split())
ans = [-1] * n
for _ in range(m):
s, c = map(int, input().split())
if ans[s - 1] == -1:
ans[s - 1] = c
elif ans[s - 1] != -1 and ans[s - 1] != c:
print(-1)
exit()
if n != 1 and ans[0] == 0:
print(-1)
exit()
if n != 1 and ans[0] == -1:
... | [
"control_flow.branch.if.condition.change"
] | 550,215 | 550,216 | u411537765 | python |
p02761 | N, M = map(int, input().split())
SC = [list(map(int, input().split())) for _ in range(M)]
for X in range(10**N):
X = str(X)
#all すべてがtrueならという意味
if len(X) == N and all(X[s-1] == str(c) for s, c in SC):
print(X[s-1])
break
else:
print(-1) | N, M = map(int, input().split())
SC = [list(map(int, input().split())) for _ in range(M)]
for X in range(10**N):
X = str(X)
#all すべてがtrueならという意味
if len(X) == N and all(X[s-1] == str(c) for s, c in SC):
print(X)
break
else:
print(-1) | [] | 550,217 | 550,218 | u861886710 | python |
p02761 | import sys
input = sys.stdin.readline
n,m = map(int,input().split())
L=[-1]*n
if n==1 and m==0:
print(0)
sys.exit()
for i in range(m):
s,c=map(int,input().split())
s-=1
if L[s]==-1 or L[s]==c:
L[s] = c
else:
print(-1)
sys.exit()
if L[0]==0:
print(-1)
... | import sys
input = sys.stdin.readline
n,m = map(int,input().split())
L=[-1]*n
if n==1 and m==0:
print(0)
sys.exit()
for i in range(m):
s,c=map(int,input().split())
s-=1
if L[s]==-1 or L[s]==c:
L[s] = c
else:
print(-1)
sys.exit()
if L[0]==0 and n>1:
print(-1)
sys.... | [
"control_flow.branch.if.condition.change"
] | 550,223 | 550,222 | u505564549 | python |
p02761 | N,M = list(map(int,input().split()))
A = ['a']*N
for i in range(M):
s,c = list(map(int,input().split()))
if A[s-1] != 'a' and A[s-1] != str(c):
print('-1')
exit()
else:
A[s-1] = str(c)
if A[0] == '0' and len(A) != 1:
print('-1')
exit()
elif A[0] == 'a' and len(A) != 1:
A[0] == '1'
for i in range... | N,M = list(map(int,input().split()))
A = ['a']*N
for i in range(M):
s,c = list(map(int,input().split()))
if A[s-1] != 'a' and A[s-1] != str(c):
print('-1')
exit()
else:
A[s-1] = str(c)
if A[0] == '0' and len(A) != 1:
print('-1')
exit()
elif A[0] == 'a' and len(A) != 1:
A[0] = '1'
for i in range(... | [
"expression.operation.compare.replace.remove",
"assignment.replace.add",
"misc.typo"
] | 550,226 | 550,227 | u514118270 | python |
p02761 | import sys
N, M = map(int, input().split())
SC = [list(map(int, input().split())) for _ in range(M)]
flagN = [False]*N
numN = [0]*N
numN[0] = 1
for sc in SC:
s, c = sc[0], sc[1]
if flagN[s-1] == False:
flagN[s-1] = True
numN[s-1] = c
elif numN[s-1] == c:
continue
else:
print(-1)
sys.ex... | import sys
N, M = map(int, input().split())
SC = [list(map(int, input().split())) for _ in range(M)]
flagN = [False]*N
numN = [0]*N
if N > 1:
numN[0] = 1
for sc in SC:
s, c = sc[0], sc[1]
if flagN[s-1] == False:
flagN[s-1] = True
numN[s-1] = c
elif numN[s-1] == c:
continue
else:
print(-1)... | [
"control_flow.branch.if.add"
] | 550,228 | 550,229 | u377834804 | python |
p02761 | n, m = map(int, input().split())
ans = ['0'] * n
for i in range(m):
s, c = map(int,input().split())
if s == 1 and c == 0 and n != 1:
print(-1)
break
if ans[s-1] != '0' and c != ans[s-1]:
print(-1)
break
ans[s-1] = c
else:
if n == 1 and int(ans[0]) == 0:
print(... | n, m = map(int, input().split())
ans = ['0'] * n
for i in range(m):
s, c = map(int,input().split())
if s == 1 and c == 0 and n != 1:
print(-1)
break
if ans[s-1] != '0' and c != ans[s-1]:
print(-1)
break
ans[s-1] = c
else:
if n == 1 and int(ans[0]) == 0:
print(... | [
"control_flow.break.remove",
"control_flow.exit.add",
"call.add"
] | 550,251 | 550,252 | u658915215 | python |
p02761 | n, m = map(int, input().split())
ans = ['0'] * n
for i in range(m):
s, c = map(int,input().split())
if s == 1 and c == 0 and n != 1:
print(-1)
break
if ans[s-1] != '0' and c != ans[s-1]:
print(-1)
break
ans[s-1] = c
else:
if n == 1 and int(ans[0]) == 0:
print(... | n, m = map(int, input().split())
ans = ['0'] * n
for i in range(m):
s, c = map(int,input().split())
if s == 1 and c == 0 and n != 1:
print(-1)
break
if ans[s-1] != '0' and c != ans[s-1]:
print(-1)
break
ans[s-1] = c
else:
if n == 1 and int(ans[0]) == 0:
print(... | [
"call.add"
] | 550,253 | 550,252 | u658915215 | python |
p02761 | n,m=map(int,input().split())
s,c=[],[]
t=0
for i in range(m):
a,b=map(int,input().split())
s.append(a)
c.append(b)
ans=[10]*n
for i in range(m):
if ans[s[i]-1]==10:
ans[s[i]-1]=c[i]
elif ans[s[i]-1]!=10 and ans[s[i]-1]!=c[i]:
t=-1
if t==-1:
print(-1)
elif n==1 and (ans[0]==0 or ... | n,m=map(int,input().split())
s,c=[],[]
t=0
for i in range(m):
a,b=map(int,input().split())
s.append(a)
c.append(b)
ans=[10]*n
for i in range(m):
if ans[s[i]-1]==10:
ans[s[i]-1]=c[i]
elif ans[s[i]-1]!=10 and ans[s[i]-1]!=c[i]:
t=-1
if t==-1:
print(-1)
elif n==1 and (ans[0]==0 or ... | [
"expression.operation.compare.replace.remove",
"assignment.replace.add",
"misc.typo"
] | 550,256 | 550,257 | u271210469 | python |
p02761 | import sys
N, M = map(int, input().split())
s = [0] * M
c = [0] * M
for i in range(M):
s[i], c[i] = map(int, input().split())
for i in range(1000):
S = str(i)
if len(S) != N:
continue
for j in range(M):
if int(S[s[j]-1]) != c[j]:
break
if j == M-1:
pr... | import sys
N, M = map(int, input().split())
s = [0] * M
c = [0] * M
for i in range(M):
s[i], c[i] = map(int, input().split())
for i in range(1000):
S = str(i)
if len(S) != N:
continue
for j in range(M):
if int(S[s[j]-1]) != c[j]:
break
if j == M-1:
pr... | [
"call.add"
] | 550,258 | 550,259 | u698902360 | python |
p02761 | from math import ceil,floor,comb,factorial,gcd,pow,sqrt,log2,cos,sin,tan,pi,inf
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import... | from math import ceil,floor,comb,factorial,gcd,pow,sqrt,log2,cos,sin,tan,pi,inf
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import... | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 550,278 | 550,279 | u603958124 | python |
p02761 | if __name__ == "__main__":
n, m = map(int, input().split())
sc = list()
for i in range(m):
sc.append(list(map(int, input().split())))
for i in range(1000):
s = str(i).zfill(3)
if n == 3 and s[0] == '0':
continue
if n == 2 and s[1] == '0':
continue... | if __name__ == "__main__":
n, m = map(int, input().split())
sc = list()
for i in range(m):
sc.append(list(map(int, input().split())))
for i in range(1000):
s = str(i).zfill(3)
if n == 3 and s[0] == '0':
continue
if n == 2 and s[1] == '0':
continue... | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 550,305 | 550,306 | u426649993 | python |
p02761 | n,m=map(int,input().split())
jouken=[]
for x in range(m):
jouken.append(list(map(int,input().split())))
for x in range(10**n):
ans=0
xx=str(x)
if not len(xx)==n:
continue
for y in range(m):
a=jouken[y][0]-1
b=jouken[y][1]
if not int(xx[a])==b:
ans+=1
if ans==0:
prin... | n,m=map(int,input().split())
jouken=[]
for x in range(m):
jouken.append(list(map(int,input().split())))
for x in range(10**n):
ans=0
xx=str(x)
if not len(xx)==n:
continue
for y in range(m):
a=jouken[y][0]-1
b=jouken[y][1]
if not int(xx[a])==b:
ans+=1
if ans==0:
prin... | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 550,309 | 550,310 | u516554284 | python |
p02761 | N,M = map(int,input().split())
ret = ['a']*N
for _ in range(M):
s,c = map(int,input().split())
if ret[s-1] not in ['a', c]:
print(-1)
exit()
ret[s-1] = c
if ret[0] == 0:
if N != 1:
print(-1)
exit()
ans = ''
for i in range(N):
if ret[i] != 'a':
ans += str(ret[i])
else:
if i == 0:
... | N,M = map(int,input().split())
ret = ['a']*N
for _ in range(M):
s,c = map(int,input().split())
if ret[s-1] not in ['a', c]:
print(-1)
exit()
ret[s-1] = c
if ret[0] == 0:
if N != 1:
print(-1)
exit()
ans = ''
for i in range(N):
if ret[i] != 'a':
ans += str(ret[i])
else:
if i == 0 and N... | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 550,321 | 550,322 | u760794812 | python |
p02761 | n, m = map(int, input().split())
ans = ['t'] * n
for _ in range(m):
s, c = map(int, input().split())
if ans[s-1] =='t' or ans[s-1] == str(c):
ans[s-1]= str(c)
else:
print(-1)
exit(0)
if ans[0] == 't':
ans[0]=str(1)
ans = ''.join(ans).replace('t', str(0))
ans = int(ans)
l = str(... | n, m = map(int, input().split())
ans = ['t'] * n
for _ in range(m):
s, c = map(int, input().split())
if ans[s-1] =='t' or ans[s-1] == str(c):
ans[s-1]= str(c)
else:
print(-1)
exit(0)
if ans[0] == 't' and n >1:
ans[0]=str(1)
ans = ''.join(ans).replace('t', str(0))
ans = int(ans)... | [
"control_flow.branch.if.condition.change"
] | 550,327 | 550,328 | u137226361 | python |
p02761 | N, M = map(int,input().split())
num = [0,1,2,3,4,5,6,7,8,9]
ans = [str(i) for i in range(10**(N-1), 10**N)]
check = [1 for i in range(10**(N-1), 10**N)]
if N == 1:
ans.insert(0,0)
check.insert(0,1)
for i in range(M):
s, c = map(int,input().split())
s -= 1
for idx, j in enumerate(ans):
if j[... | N, M = map(int,input().split())
num = [0,1,2,3,4,5,6,7,8,9]
ans = [str(i) for i in range(10**(N-1), 10**N)]
check = [1 for i in range(10**(N-1), 10**N)]
if N == 1:
ans.insert(0,"0")
check.insert(0,1)
for i in range(M):
s, c = map(int,input().split())
s -= 1
for idx, j in enumerate(ans):
if ... | [
"call.arguments.change"
] | 550,331 | 550,332 | u735891571 | python |
p02761 | N,M = map(int,input().split())
keep_value = [None]*N
check = False
for i in range(M):
s,c = map(int,input().split())
if((keep_value[s-1]!=None) and (keep_value[s-1]!=c)):
print('-1')
exit()
else:
keep_value[s-1]=c
if(None not in keep_value):
print(''.join(map(str,keep_value)))
el... | N,M = map(int,input().split())
keep_value = [None]*N
check = False
for i in range(M):
s,c = map(int,input().split())
if((keep_value[s-1]!=None) and (keep_value[s-1]!=c)):
print('-1')
exit()
else:
keep_value[s-1]=c
if(None not in keep_value):
print(''.join(map(str,keep_value)))
el... | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 550,337 | 550,338 | u388971072 | python |
p02761 | N,M = map(int,input().split())
keep_value = [None]*N
check = False
for i in range(M):
s,c = map(int,input().split())
if((keep_value[s-1]!=None) and (keep_value[s-1]!=c)):
print('-1')
exit()
else:
keep_value[s-1]=c
if(None not in keep_value):
print(''.join(map(str,keep_value)))
el... | N,M = map(int,input().split())
keep_value = [None]*N
check = False
for i in range(M):
s,c = map(int,input().split())
if((keep_value[s-1]!=None) and (keep_value[s-1]!=c)):
print('-1')
exit()
else:
keep_value[s-1]=c
if(None not in keep_value):
print(''.join(map(str,keep_value)))
el... | [
"control_flow.branch.if.condition.change"
] | 550,339 | 550,338 | u388971072 | python |
p02761 | import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from math import gcd
def input():
return sys.stdin.readline()[:-1]
def ruiseki(lst):
return [0]+list(accumulate(lst))
mod=pow(10,9)+7
n,m=map(int,input().split())
sc=[l... | import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from math import gcd
def input():
return sys.stdin.readline()[:-1]
def ruiseki(lst):
return [0]+list(accumulate(lst))
mod=pow(10,9)+7
n,m=map(int,input().split())
sc=[l... | [
"control_flow.branch.if.condition.change"
] | 550,369 | 550,370 | u654470292 | python |
p02761 | import sys
n, m = map(int, input().split())
sc = [list(map(int, input().split())) for _ in range(m)]
ans = [-1] * n
for i in sc:
s, c = i
if (ans[s-1] == c) | (ans[s-1] == -1):
ans[s-1] = c
else:
print(-1)
sys.exit()
for i in range(n):
if ans[i] == -1:
if (i == 0) & (n ... | import sys
n, m = map(int, input().split())
sc = [list(map(int, input().split())) for _ in range(m)]
ans = [-1] * n
for i in sc:
s, c = i
if (ans[s-1] == c) | (ans[s-1] == -1):
ans[s-1] = c
else:
print(-1)
sys.exit()
for i in range(n):
if ans[i] == -1:
if (i == 0) & (n ... | [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 550,371 | 550,372 | u222668979 | python |
p02761 | import sys
n,m = map(int, input().split())
num = [0]*n
count = [0]*n
for _ in range(m):
b,c = map(int, input().split())
if num[b-1] != c and count[b-1] > 0:
print(-1)
sys.exit()
count[b-1]+=1
num[b-1] = c
if n == 3 and num[0] == 0 and count[0] == 0:
num[0] == 1
elif n == 3 and... | import sys
n,m = map(int, input().split())
num = [0]*n
count = [0]*n
for _ in range(m):
b,c = map(int, input().split())
if num[b-1] != c and count[b-1] > 0:
print(-1)
sys.exit()
count[b-1]+=1
num[b-1] = c
if n == 3 and num[0] == 0 and count[0] == 0:
num[0] = 1
elif n == 3 and ... | [
"expression.operation.compare.replace.remove",
"assignment.replace.add",
"misc.typo"
] | 550,377 | 550,378 | u518891382 | python |
p02761 | n, m = map(int, input().split())
s = []
c = []
for i in range(n):
S, C = map(int, input().split())
s.append(S)
c.append(C)
for i in range(10 **(n + 1)):
tmp = str(i)
if len(tmp) == n and all([tmp[s[j] - 1] == str(c[j]) for j in range(m)]):
print(tmp)
exit()
print(-1) | n, m = map(int, input().split())
s = []
c = []
for i in range(m):
S, C = map(int, input().split())
s.append(S)
c.append(C)
for i in range(10 **(n + 1)):
tmp = str(i)
if len(tmp) == n and all([tmp[s[j] - 1] == str(c[j]) for j in range(m)]):
print(tmp)
exit()
print(-1) | [
"identifier.change",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 550,379 | 550,380 | u004482945 | python |
p02761 | N,M = map(int,input().split())
ans = [-1] * N
for i in range(M):
s,c = map(int,input().split())
if ans[s-1] != -1 and ans[s-1] != c :
print(-1)
exit()
t[s-1] = c
if N != 1 :
if ans[0] == 0 :
print(-1)
exit()
if ans[0] == -1 :
ans[0] = 1
for i in range(N... | N,M = map(int,input().split())
ans = [-1] * N
for i in range(M):
s,c = map(int,input().split())
if ans[s-1] != -1 and ans[s-1] != c :
print(-1)
exit()
ans[s-1] = c
if N != 1 :
if ans[0] == 0 :
print(-1)
exit()
if ans[0] == -1 :
ans[0] = 1
for i in range... | [
"assignment.variable.change",
"identifier.change"
] | 550,383 | 550,384 | u453623947 | python |
p02761 | import sys
def main():
n, m = map(int, input().split())
s = [tuple(map(int, input().split())) for _ in range(m)]
s = set(s)
len_s = len(s)
if len_s != len(set([sc[0] for sc in s])):
print(-1)
sys.exit()
if m == 0 and n == 1:
print(0)
sys.exit()
r = -1
for... | import sys
def main():
n, m = map(int, input().split())
s = [tuple(map(int, input().split())) for _ in range(m)]
s = set(s)
len_s = len(s)
if len_s != len(set([sc[0] for sc in s])):
print(-1)
sys.exit()
if m == 0 and n == 1:
print(0)
sys.exit()
r = -1
for... | [
"literal.number.integer.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change"
] | 550,393 | 550,394 | u072717685 | python |
p02761 | import sys
N, M = map(int, input().split())
#とりまぶっこむ
SClis = []
for _ in range(M):
a, b = map(int, input().split())
SClis.append([a,b])
ans = [-1]*N
for i in range(M):
singlelis = SClis[i]
S = (singlelis[0] - 1)
C = (singlelis[1])
if ans[S] != -1 and ans[S] != C:
print(-1)
... | import sys
N, M = map(int, input().split())
#とりまぶっこむ
SClis = []
for _ in range(M):
a, b = map(int, input().split())
SClis.append([a,b])
ans = [-1]*N
for i in range(M):
singlelis = SClis[i]
S = (singlelis[0] - 1)
C = (singlelis[1])
if ans[S] != -1 and ans[S] != C:
print(-1)
... | [
"call.add"
] | 550,397 | 550,398 | u609814378 | python |
p02761 | N,M = map(int,input().split())
li = ["#"]*N
A = "#"
if N==1:
for i in range(M):
s,c = map(int,input().split())
if not c==A and not c=="#":
print(-1)
exit()
else:
A=c
if A == "#":
print(0)
else:
print(int(A))
exit()
fo... | N,M = map(int,input().split())
li = ["#"]*N
A = "#"
if N==1:
for i in range(M):
s,c = map(int,input().split())
if not c==A and not A=="#":
print(-1)
exit()
else:
A=c
if A == "#":
print(0)
else:
print(int(A))
exit()
fo... | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 550,401 | 550,402 | u772029934 | python |
p02761 | N,M = map(int,input().split())
li = ["#"]*N
A = "#"
if N==1:
for i in range(M):
s,c = map(int,input().split())
if not c==A and not c=="#":
print(-1)
break
else:
A=c
if A == "#":
print(0)
else:
print(int(A))
exit()
for... | N,M = map(int,input().split())
li = ["#"]*N
A = "#"
if N==1:
for i in range(M):
s,c = map(int,input().split())
if not c==A and not A=="#":
print(-1)
exit()
else:
A=c
if A == "#":
print(0)
else:
print(int(A))
exit()
fo... | [
"identifier.change",
"control_flow.branch.if.condition.change",
"control_flow.break.remove",
"control_flow.exit.add",
"call.add"
] | 550,403 | 550,402 | u772029934 | python |
p02761 | n,m = map(int,input().split())
sc = [list(map(int,input().split())) for i in range(m)]
temp = [-1] * n
ans = -1
for i in sc:
if temp[i[0]-1] != -1 and temp[i[0]-1] != i[1]:
print(-1)
exit()
temp[i[0]-1] = i[1]
if n == 1:
mini = 0
maxi = 10
if n == 2:
mini = 10
maxi = 100
if n =... | n,m = map(int,input().split())
sc = [list(map(int,input().split())) for i in range(m)]
temp = [-1] * n
ans = -1
for i in sc:
if temp[i[0]-1] != -1 and temp[i[0]-1] != i[1]:
print(-1)
exit()
temp[i[0]-1] = i[1]
if n == 1:
mini = 0
maxi = 10
if n == 2:
mini = 10
maxi = 100
if n =... | [
"call.remove"
] | 550,414 | 550,415 | u564770050 | python |
p02761 | #157
def main():
N, M = map(int,input().split())
num = [-1]*N
for i in range(M):
s, c = map(int,input().split())
if(s==1 and c==0 and N!=1):
print(-1)
return
if(num[s-1]==-1 or num[s-1]==c):
num[s-1] = c
else:
print(-1)
... | #157
def main():
N, M = map(int,input().split())
num = [-1]*N
for i in range(M):
s, c = map(int,input().split())
if(s==1 and c==0 and N!=1):
print(-1)
return
if(num[s-1]==-1 or num[s-1]==c):
num[s-1] = c
else:
print(-1)
... | [
"identifier.change",
"call.function.change"
] | 550,420 | 550,421 | u966836999 | python |
p02761 | N, M = list(map(int, input().split()))
ans = [-1]*N
flag = True
if N == 1:
for _ in range(M):
s, c = list(map(int, input().split()))
if ans[s-1] == -1:
ans[s-1] = c
else:
if ans[s-1] != c:
flag = False
break
if flag:
print... | N, M = list(map(int, input().split()))
ans = [-1]*N
flag = True
if N == 1:
for _ in range(M):
s, c = list(map(int, input().split()))
if ans[s-1] == -1:
ans[s-1] = c
else:
if ans[s-1] != c:
flag = False
break
if flag:
print... | [
"call.add",
"call.arguments.change"
] | 550,426 | 550,427 | u098968285 | python |
p02761 | N,M=map(int,input().split())
sc=[list(map(int,input().split()))for _ in [0]*M]
ans=['1']+['0']*(N-1)
count=[0]*N
for s,c in sc:
if count[s-1]==1 and ans[s-1]!=str(c):
ans='-1'
break
else:
ans[s-1]=str(c)
count[s-1]=1
if N>=2 and ans[0]=='0':
ans='-1'
if M==0:
ans='0'
... | N,M=map(int,input().split())
sc=[list(map(int,input().split()))for _ in [0]*M]
ans=['1']+['0']*(N-1)
count=[0]*N
for s,c in sc:
if count[s-1]==1 and ans[s-1]!=str(c):
ans='-1'
break
else:
ans[s-1]=str(c)
count[s-1]=1
if N>=2 and ans[0]=='0':
ans='-1'
if M==0 and N==1:
... | [
"control_flow.branch.if.condition.change"
] | 550,428 | 550,429 | u391819434 | python |
p02761 | n,m=map(int,input().split())
a=['.']
a*=n
ans=0
for i in range(m):
si,ci=input().split()
si=int(si)
ci=str(ci)
if a[si-1]=='.':
a[si-1]=ci
else:
if a[si-1]==ci:
continue
else:
ans=-1
break
if ans==-1 or (n>=2 and a[0]=='0'):
print(-1)
... | n,m=map(int,input().split())
a=['.']
a*=n
ans=0
for i in range(m):
si,ci=input().split()
si=int(si)
ci=str(ci)
if a[si-1]=='.':
a[si-1]=ci
else:
if a[si-1]==ci:
continue
else:
ans=-1
break
if ans==-1 or (n>=2 and a[0]=='0'):
print(-1)
... | [] | 550,434 | 550,435 | u919235786 | python |
p02761 | n,m=map(int,input().split())
a=['.']
a*=n
ans=0
for i in range(m):
si,ci=input().split()
si=int(si)
ci=str(ci)
if a[si-1]=='.':
a[si-1]=ci
else:
if a[si-1]==ci:
continue
else:
ans=-1
break
if ans==-1 or (n>=2 and a[0]=='0'):
print(-1)
... | n,m=map(int,input().split())
a=['.']
a*=n
ans=0
for i in range(m):
si,ci=input().split()
si=int(si)
ci=str(ci)
if a[si-1]=='.':
a[si-1]=ci
else:
if a[si-1]==ci:
continue
else:
ans=-1
break
if ans==-1 or (n>=2 and a[0]=='0'):
print(-1)
... | [] | 550,436 | 550,435 | u919235786 | python |
p02761 | N,M=map(int,input().split())
s=[]
c=[]
for i in range(M):
a,b=map(int,input().split())
s.append(a)
c.appemd(b)
found=False
start=pow(10,N-1)
stop=pow(10,N)
if N==1:
start=0
for i in range(start,stop):
i_str=str(i)
passed=True
for j in range(M):
if not i_str[s[j]-1]==str(c[j]):
... | N,M=map(int,input().split())
s=[]
c=[]
for i in range(M):
a,b=map(int,input().split())
s.append(a)
c.append(b)
found=False
start=pow(10,N-1)
stop=pow(10,N)
if N==1:
start=0
for i in range(start,stop):
i_str=str(i)
passed=True
for j in range(M):
if not i_str[s[j]-1]==str(c[j]):
... | [
"identifier.change",
"misc.opposites",
"assignment.value.change"
] | 550,449 | 550,450 | u194472175 | python |
p02761 | n, m = map(int, input().split())
order = []
num = [-1 for i in range(n)]
for i in range(m):
tmp = [int(i) for i in input().split()]
order.append(tmp)
flag = True
for od in order:
if num[od[0]-1] == -1:
num[od[0]-1] = od[1]
else:
if num[od[0]-1] != od[1]:
flag = False
if num[0] == 0 and n != ... | n, m = map(int, input().split())
order = []
num = [-1 for i in range(n)]
for i in range(m):
tmp = [int(i) for i in input().split()]
order.append(tmp)
flag = True
for od in order:
if num[od[0]-1] == -1:
num[od[0]-1] = od[1]
else:
if num[od[0]-1] != od[1]:
flag = False
if num[0] == 0 and n != ... | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 550,493 | 550,494 | u821989875 | python |
p02761 | import sys
n,m=map(int,input().split())
l=[-1]*(n)
for i in range(m):
s,c=map(int,input().split())
if l[s-1]==-1 or l[s-1]==c:
l[s-1]=c
else:
print(-1)
sys.exit()
if l[0]==0 and len(l)!=1:
print(-1)
sys.exit()
for i in range(n):
if l[i]==-1:
l[i]=0
if l[0]==0 and ... | import sys
n,m=map(int,input().split())
l=[-1]*(n)
for i in range(m):
s,c=map(int,input().split())
if l[s-1]==-1 or l[s-1]==c:
l[s-1]=c
else:
print(-1)
sys.exit()
if l[0]==0 and len(l)!=1:
print(-1)
sys.exit()
for i in range(n):
if l[i]==-1:
l[i]=0
if l[0]==0 and ... | [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 550,503 | 550,504 | u474925961 | python |
p02761 | import sys
n,m=map(int,input().split())
l=[-1]*(n)
for i in range(m):
s,c=map(int,input().split())
if l[s-1]==-1 or l[s-1]==c:
l[s-1]=c
else:
print(-1)
sys.exit()
if l[0]==0 and len(l)!=1:
print(-1)
sys.exit()
for i in range(n):
if l[i]==-1:
l[i]=0
if l[0]==0 and ... | import sys
n,m=map(int,input().split())
l=[-1]*(n)
for i in range(m):
s,c=map(int,input().split())
if l[s-1]==-1 or l[s-1]==c:
l[s-1]=c
else:
print(-1)
sys.exit()
if l[0]==0 and len(l)!=1:
print(-1)
sys.exit()
for i in range(n):
if l[i]==-1:
l[i]=0
if l[0]==0 and ... | [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"literal.number.integer.change",
"assignment.value.change"
] | 550,505 | 550,504 | u474925961 | python |
p02761 | def main():
n, m = map(int, input().split())
sc = [list(map(int, input().split())) for _ in range(m)]
ans = [-1]* n
for s, c in sc:
s -= 1
if ans[s] == -1or ans[s] == c:
ans[s] = c
else:
print(-1)
return
if ans[0] == -1:
... | def main():
n, m = map(int, input().split())
sc = [list(map(int, input().split())) for _ in range(m)]
ans = [-1]* n
for s, c in sc:
s -= 1
if ans[s] == -1or ans[s] == c:
ans[s] = c
else:
print(-1)
return
if ans[0] == -1 and n... | [
"control_flow.branch.if.condition.change"
] | 550,513 | 550,514 | u167647458 | python |
p02761 | n , m = map(int, input().split())
num = [-1] * n
for _ in range(m):
s, c = map(int, input().split())
if s == 1 and c == 0 and n > 1:
print(-1)
exit()
if num[s-1] == -1 or num[s-1] == c:
num[s-1] = c
else:
print(-1)
exit()
for i in range(n):
if i == 0 and nu... | n , m = map(int, input().split())
num = [-1] * n
for _ in range(m):
s, c = map(int, input().split())
if s == 1 and c == 0 and n > 1:
print(-1)
exit()
if num[s-1] == -1 or num[s-1] == c:
num[s-1] = c
else:
print(-1)
exit()
for i in range(n):
if i == 0 and nu... | [
"expression.operation.compare.replace.remove",
"assignment.replace.add",
"misc.typo"
] | 550,540 | 550,541 | u826785572 | python |
p02761 | n, m = map(int,input().split())
n_list = []
for i in range(m):
s, c = map(int,input().split())
n_list.append([s, c])
n_list = list(tuple(sorted(n_list)))
keta = [-1 for i in range(n)]
flag = 0
for i in range(len(n_list)):
if keta[n_list[i][0]-1] == -1:
keta[n_list[i][0]-1] = n_list[i][1]
eli... | n, m = map(int,input().split())
n_list = []
for i in range(m):
s, c = map(int,input().split())
n_list.append([s, c])
n_list = list(tuple(sorted(n_list)))
keta = [-1 for i in range(n)]
flag = 0
for i in range(len(n_list)):
if keta[n_list[i][0]-1] == -1:
keta[n_list[i][0]-1] = n_list[i][1]
eli... | [
"literal.number.integer.change",
"variable_access.subscript.index.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 550,571 | 550,572 | u436982376 | python |
p02761 | N,M = map(int,input().split())
num = [-1 for _ in range(N)]
flag = False
for i in range(M):
s,c = map(int,input().split())
if num[s-1] == -1 or num[s-1] == c:
num[s-1] = c
else:
break
else:
flag = True
if flag==False or (num[0]==0 and N>1):
print(-1)
else:
ans = 0
if num[0... | N,M = map(int,input().split())
num = [-1 for _ in range(N)]
flag = False
for i in range(M):
s,c = map(int,input().split())
if num[s-1] == -1 or num[s-1] == c:
num[s-1] = c
else:
break
else:
flag = True
if flag==False or (num[0]==0 and N>1):
print(-1)
else:
ans = 0
if num[0... | [
"control_flow.branch.if.condition.change"
] | 550,573 | 550,574 | u582415761 | python |
p02761 | N,M = map(int,input().split())
num = [-1 for _ in range(N)]
flag = False
for i in range(M):
s,c = map(int,input().split())
if num[s-1] == -1 or num[s-1] == c:
num[s-1] = c
else:
break
else:
flag = True
if flag==False or (num[0]==0 and N==1):
print(-1)
else:
ans = 0
if num[... | N,M = map(int,input().split())
num = [-1 for _ in range(N)]
flag = False
for i in range(M):
s,c = map(int,input().split())
if num[s-1] == -1 or num[s-1] == c:
num[s-1] = c
else:
break
else:
flag = True
if flag==False or (num[0]==0 and N>1):
print(-1)
else:
ans = 0
if num[0... | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 550,575 | 550,574 | u582415761 | python |
p02761 | N, M = map(int, input().split())
l = ["a"] * N
for i in range(M):
s, c = map(int, input().split())
if l[s-1] == "a" or l[s-1] == c:
l[s-1] = c
else:
print(-1)
exit()
if l[0] == "a":
l[0] = 1
elif l[0] == 0 and N != 1:
print(-1)
exit()
for i in range(N):
if l[i-1] ... | N, M = map(int, input().split())
l = ["a"] * N
for i in range(M):
s, c = map(int, input().split())
if l[s-1] == "a" or l[s-1] == c:
l[s-1] = c
else:
print(-1)
exit()
if l[0] == "a" and N != 1:
l[0] = 1
elif l[0] == 0 and N != 1:
print(-1)
exit()
#elif l[0] == 0 and N =... | [
"control_flow.branch.if.condition.change"
] | 550,592 | 550,593 | u048176319 | python |
p02761 | n,m=map(int,input().split())
l=[]
for i in range(m):
s,c=map(int,input().split())
l.append((s,c))
ans=0
for i in range(1,1000):
k=str(i)
cnt=0
if len(k)==n:
for j in range(m):
if int(k[l[j][0]-1])==l[j][1]:
cnt+=1
if cnt==m:
ans=i
... | n,m=map(int,input().split())
l=[]
for i in range(m):
s,c=map(int,input().split())
l.append((s,c))
ans=-1
for i in range(1000):
k=str(i)
cnt=0
if len(k)==n:
for j in range(m):
if int(k[l[j][0]-1])==l[j][1]:
cnt+=1
if cnt==m:
ans=i
b... | [
"assignment.value.change",
"expression.operation.unary.add",
"call.arguments.change",
"control_flow.branch.if.condition.change"
] | 550,596 | 550,597 | u674959776 | python |
p02761 | n,m=map(int,input().split())
l=[]
for i in range(m):
s,c=map(int,input().split())
l.append((s,c))
ans=0
for i in range(1000):
k=str(i)
cnt=0
if len(k)==n:
for j in range(m):
if int(k[l[j][0]-1])==l[j][1]:
cnt+=1
if cnt==m:
ans=i
br... | n,m=map(int,input().split())
l=[]
for i in range(m):
s,c=map(int,input().split())
l.append((s,c))
ans=-1
for i in range(1000):
k=str(i)
cnt=0
if len(k)==n:
for j in range(m):
if int(k[l[j][0]-1])==l[j][1]:
cnt+=1
if cnt==m:
ans=i
b... | [
"assignment.value.change",
"expression.operation.unary.add",
"control_flow.branch.if.condition.change"
] | 550,598 | 550,597 | u674959776 | python |
p02761 | def main():
n, m = map(int, input().split())
ans = [-1]*n
for _ in range(m):
s, c = map(int, input().split())
if ans[s-1] == -1:
ans[s-1] = c
elif ans[s-1] != -1 and ans[s-1] != c:
print(-1)
exit()
if n == 1:
if ans[0] == -1:
... | def main():
n, m = map(int, input().split())
ans = [-1]*n
for _ in range(m):
s, c = map(int, input().split())
if ans[s-1] == -1:
ans[s-1] = c
elif ans[s-1] != -1 and ans[s-1] != c:
print(-1)
exit()
if n == 1:
if ans[0] == -1:
... | [
"control_flow.branch.if.condition.change",
"expression.operation.unary.remove"
] | 550,603 | 550,604 | u044964932 | python |
p02761 | def main():
n, m = map(int, input().split())
ans = [-1]*n
for _ in range(m):
s, c = map(int, input().split())
if ans[s-1] == -1:
ans[s-1] = c
elif ans[s-1] != -1 and ans[s-1] != c:
print(-1)
exit()
if n == 1:
if ans[0] == -1:
... | def main():
n, m = map(int, input().split())
ans = [-1]*n
for _ in range(m):
s, c = map(int, input().split())
if ans[s-1] == -1:
ans[s-1] = c
elif ans[s-1] != -1 and ans[s-1] != c:
print(-1)
exit()
if n == 1:
if ans[0] == -1:
... | [
"control_flow.branch.if.condition.change",
"expression.operation.unary.remove",
"call.arguments.add"
] | 550,605 | 550,604 | u044964932 | python |
p02761 | n,m=map(int,input().split())
sc=[list(map(int,input().split())) for i in range(m)]
start=10**(n-1)
end=10**n
if n == 1:
start = 0
for i in range(start,end):
i=str(i)
for s,c in sc:
if i[s-1] != str(c):
break
else:
print(i)
break
print(-1) | n,m=map(int,input().split())
sc=[list(map(int,input().split())) for i in range(m)]
start=10**(n-1)
end=10**n
if n == 1:
start = 0
for i in range(start,end):
i=str(i)
for s,c in sc:
if i[s-1] != str(c):
break
else:
print(i)
exit()
print(-1) | [
"control_flow.break.remove",
"control_flow.exit.add",
"call.add"
] | 550,613 | 550,614 | u238940874 | python |
p02761 | def main():
import sys
input = sys.stdin.readline
n,m=map(int,input().split())
if m==0:
if n==1:
print(0)
exit()
else:
print(-1)
exit()
sc=[list(map(int,input().split())) for _ in range(m)]
sc=list(map(list, set(map(tuple, sc))))
sc=sorted(sc,key=lambda x: (x[0],x[1]))
if... | def main():
import sys
input = sys.stdin.readline
n,m=map(int,input().split())
if m==0:
if n==1:
print(0)
exit()
else:
print(pow(10,n-1))
exit()
sc=[list(map(int,input().split())) for _ in range(m)]
sc=list(map(list, set(map(tuple, sc))))
sc=sorted(sc,key=lambda x: (x[0],x[... | [
"call.add",
"call.arguments.change"
] | 550,619 | 550,620 | u652569315 | python |
p02761 | N,M = map(int,input().split())
SC = [tuple(map(int,input().split())) for i in range(M)]
if N==1:
r = range(10)
elif N==2:
r = range(10,100)
else:
r = range(100,1000)
for n in r:
print(n)
n = str(n)
for s,c in SC:
#print("s=",s,"c",c)
if n[s-1] != str(c):
break
els... | N,M = map(int,input().split())
SC = [tuple(map(int,input().split())) for i in range(M)]
if N==1:
r = range(10)
elif N==2:
r = range(10,100)
else:
r = range(100,1000)
for n in r:
#print(n)
n = str(n)
for s,c in SC:
#print("s=",s,"c",c)
if n[s-1] != str(c):
break
el... | [
"call.remove"
] | 550,644 | 550,645 | u391675400 | python |
p02761 | N, M = map(int, input().split())
sc = [tuple(map(int, input().split())) for _ in range(M)]
def cands(N):
if N ==1:
return range(10)
else:
return range(10 ** (N-1), 10 **N)
def main(N, sc):
nums = cands(N)
print(nums)
for n in nums:
try:
for s,c in sc:
... | N, M = map(int, input().split())
sc = [tuple(map(int, input().split())) for _ in range(M)]
def cands(N):
if N ==1:
return range(10)
else:
return range(10 ** (N-1), 10 **N)
def main(N, sc):
nums = cands(N)
for n in nums:
try:
for s,c in sc:
assert(int(... | [
"call.remove"
] | 550,648 | 550,649 | u221537793 | python |
p02761 | n, m = map(int, input().split())
s = [0]*m
c = [0]*m
for i in range(m):
s[i], c[i] = map(int, input().split())
ans = -1
for num in range(1, 1000):
num_car = str(num)
con1 = len(num_car) == n
con2 = True
for i in range(m):
if con1 and num_car[s[i] - 1] != str(c[i]):
con2 = Fal... | n, m = map(int, input().split())
s = [0]*m
c = [0]*m
for i in range(m):
s[i], c[i] = map(int, input().split())
ans = -1
for num in range(0, 1000):
num_car = str(num)
con1 = len(num_car) == n
con2 = True
for i in range(m):
if con1 and num_car[s[i] - 1] != str(c[i]):
con2 = Fal... | [
"literal.number.integer.change",
"call.arguments.change",
"control_flow.loop.range.bounds.lower.change"
] | 550,650 | 550,651 | u006880673 | python |
p02761 | n,m = map(int, input().split())
ans = [-1] *n
f= 0
for i in range(m):
s,c = map(int, input().split())
#if (ans[s-1] != -1) and (ans[s-1] != c): # 重複
if (ans[s-1] == -1) or (ans[s-1] == c):
ans[s-1] = c
else:
print('-1')
exit()
'''
f = 1
if f == 1:
print('-1')
exi... | n,m = map(int, input().split())
ans = [-1] *n
f= 0
for i in range(m):
s,c = map(int, input().split())
#if (ans[s-1] != -1) and (ans[s-1] != c): # 重複
if (ans[s-1] == -1) or (ans[s-1] == c):
ans[s-1] = c
else:
print('-1')
exit()
'''
f = 1
if f == 1:
print('-1')
exi... | [
"expression.operation.compare.replace.remove",
"assignment.replace.add",
"misc.typo"
] | 550,671 | 550,672 | u488884575 | python |
p02761 | import sys
import re
N,M = map(int,input().split())
nums = ["0"]*N
if N != 1:
nums[0] = "1"
checked = [False]*N
for i in range(M):
s,c = map(int,input().split())
s -= 1
if not checked[s]: #初めての指定
nums[s] = str(c)
checked[s] = True
elif nums[s] != str(c): #同じ場所に異なる数字が来たら作れない
... | import sys
import re
N,M = map(int,input().split())
nums = ["0"]*N
if N != 1:
nums[0] = "1"
checked = [False]*N
for i in range(M):
s,c = map(int,input().split())
s -= 1
if not checked[s]: #初めての指定
nums[s] = str(c)
checked[s] = True
elif nums[s] != str(c): #同じ場所に異なる数字が来たら作れない
... | [
"control_flow.branch.if.condition.change"
] | 550,684 | 550,685 | u757117214 | python |
p02761 | n, m = map(int, input().split())
exist = True
if n == 1:
sc_list = []
for i in range(m):
sc_list.append(list(map(int, input().split())))
if m >= 2:
for j in range(m-1):
if sc_list[j][1] != sc_list[j+1][1]:
exist = False
if exist:
if m >= 1:... | n, m = map(int, input().split())
exist = True
if n == 1:
sc_list = []
for i in range(m):
sc_list.append(list(map(int, input().split())))
if m >= 2:
for j in range(m-1):
if sc_list[j][1] != sc_list[j+1][1]:
exist = False
if exist:
if m >= 1:... | [
"assignment.variable.change",
"assignment.value.change"
] | 550,694 | 550,695 | u542190960 | python |
p02761 | n, m = list(map(int, input().split()))
out = ['a']*n
err_flg = False
err_flg2 = False
for i in range(m):
s = list(map(int, input().split()))
if s[0]==1 and s[1]==0 and n==1:
err_flg2 = True
elif m==0 and n==1:
err_flg2 = True
elif s[0]==1 and s[1]==0 and n > 1:
err_flag... | n, m = list(map(int, input().split()))
out = ['a']*n
err_flg = False
err_flg2 = False
for i in range(m):
s = list(map(int, input().split()))
# print(s)
if s[0]==1 and s[1]==0 and n==1:
err_flg2 = True
elif m==0 and n==1:
err_flg2 = True
elif s[0]==1 and s[1]==0 and n > 1:
... | [
"assignment.variable.change",
"identifier.change"
] | 550,696 | 550,697 | u936050991 | python |
p02761 | # input
N, M = map(int, input().split())
c = []
c_append = c.append
for i in range(M):
sm, cm = map(int, input().split())
c_append((sm, cm))
ans = -1
# check
for i in range(1, 1000, 1):
str_i = str(i)
if N < len(str_i):
break
if N == len(str_i) and False not in [int(str_i[sm - 1]) == ... | # input
N, M = map(int, input().split())
c = []
c_append = c.append
for i in range(M):
sm, cm = map(int, input().split())
c_append((sm, cm))
ans = -1
# check
for i in range(1000):
str_i = str(i)
if N < len(str_i):
break
if N == len(str_i) and False not in [int(str_i[sm - 1]) == cm for... | [
"call.arguments.change"
] | 550,700 | 550,701 | u284363684 | python |
p02761 | import sys
import os
def main():
if os.getenv("LOCAL"):
sys.stdin = open("input.txt", "r")
N, M = list(map(int, sys.stdin.readline().split()))
lines = [list(map(int, sys.stdin.readline().split())) for _ in range(M)]
print(lines)
ret = -1
for n in range(0, pow(10, N)):
if len(... | import sys
import os
def main():
if os.getenv("LOCAL"):
sys.stdin = open("input.txt", "r")
N, M = list(map(int, sys.stdin.readline().split()))
lines = [list(map(int, sys.stdin.readline().split())) for _ in range(M)]
ret = -1
for n in range(0, pow(10, N)):
if len(str(n)) != N:
... | [
"call.remove"
] | 550,706 | 550,707 | u634079249 | python |
p02761 | import sys;input=lambda:sys.stdin.readline().rstrip();aint=lambda:int(input());ints=lambda:list(map(int,input().split()))
import math;floor,ceil=math.floor,math.ceil
from collections import deque
Yes=lambda b:print('Yes')if b else print('No');YES=lambda b:print('YES')if b else print('NO')
is_even=lambda x:True if x%2==... | import sys;input=lambda:sys.stdin.readline().rstrip();aint=lambda:int(input());ints=lambda:list(map(int,input().split()))
import math;floor,ceil=math.floor,math.ceil
from collections import deque
Yes=lambda b:print('Yes')if b else print('No');YES=lambda b:print('YES')if b else print('NO')
is_even=lambda x:True if x%2==... | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 550,737 | 550,738 | u203588891 | python |
p02761 | n,m = map(int,input().split())
sc = [list(map(int,input().split())) for _ in range(m)]
li = [-1] * n
for s,c in sc:
if li[s-1] == -1 or li[s-1] == c:
li[s-1] = c
else:
print(-1)
exit()
if n != 1 and s == 1 and c == 0:
print(-1)
exit()
for i in range(n):
if li[i... | n,m = map(int,input().split())
sc = [list(map(int,input().split())) for _ in range(m)]
li = [-1] * n
for s,c in sc:
if li[s-1] == -1 or li[s-1] == c:
li[s-1] = c
else:
print(-1)
exit()
if n != 1 and s == 1 and c == 0:
print(-1)
exit()
for i in range(n):
if li[i... | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 550,743 | 550,744 | u623231048 | python |
p02761 | def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))
n,m = iim()
l = [-1]*n
flag = True
for i in range(m):
s,c = iim()
if l[s-1] != -1 and l[s-1] != c:
... | def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))
n,m = iim()
l = [-1]*n
flag = True
for i in range(m):
s,c = iim()
if l[s-1] != -1 and l[s-1] != c:
... | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 550,755 | 550,756 | u021916304 | python |
p02761 | N, M = map(int, input().split())
s = []
c = []
for m in range(M):
si, ci = map(int, input().split())
s.append(si)
c.append(ci)
s = 10 ** (N - 1)
if N == 1:
s -= 1
for i in range(s, 10 ** N):
for m in range(M):
if str(i)[s[m] - 1] != str(c[m]):
break
else:
print(i)
... | N, M = map(int, input().split())
s = []
c = []
for m in range(M):
si, ci = map(int, input().split())
s.append(si)
c.append(ci)
ss = 10 ** (N - 1)
if N == 1:
ss -= 1
for i in range(ss, 10 ** N):
for m in range(M):
if str(i)[s[m] - 1] != str(c[m]):
break
else:
print(i... | [
"assignment.variable.change",
"identifier.change",
"call.arguments.change",
"control_flow.loop.range.bounds.lower.change"
] | 550,757 | 550,758 | u339199690 | python |
p02761 | #!/usr/bin/env python3
N, M = map(int, input().split())
A = [list(input().split()) for i in range(M)]
if N == 1:
for i in range(1, 10):
while all(str(i)[int(A[j][0])-1] == A[j][1] for j in range(M)):
print(i)
exit()
if N == 2:
for i in range(10, 100):
while all(str(i)[... | #!/usr/bin/env python3
N, M = map(int, input().split())
A = [list(input().split()) for i in range(M)]
if N == 1:
for i in range(0, 10):
while all(str(i)[int(A[j][0])-1] == A[j][1] for j in range(M)):
print(i)
exit()
if N == 2:
for i in range(10, 100):
while all(str(i)[... | [
"literal.number.integer.change",
"call.arguments.change",
"control_flow.loop.range.bounds.lower.change"
] | 550,766 | 550,767 | u756420279 | python |
p02761 | N, M = map(int, input().split())
ans = [None] * N
for _ in range(M):
s, c = map(int, input().split())
if ans[s - 1] in [None, c]:
ans[s - 1] = c
else:
print(-1)
quit()
ans = "".join(map(lambda pair :str(pair[1]) if pair[1] != None else "0" if pair[0] else "1", enumerate(ans)))
if N ... | N, M = map(int, input().split())
ans = [None] * N
for _ in range(M):
s, c = map(int, input().split())
if ans[s - 1] in [None, c]:
ans[s - 1] = c
else:
print(-1)
quit()
ans = "".join(map(lambda pair :str(pair[1]) if pair[1] != None else "0" if pair[0] or N == 1 else "1", enumerate(an... | [] | 550,793 | 550,794 | u638282348 | python |
p02761 | import sys
N,M=list(map(int, input().split()))
s=[list(map(int, input().split())) for _ in range(M)]
a=["a" for _ in range(N+1)]
if len(s)==0 and N==1:
print(0)
sys.exit()
elif len(s)==0:
print(10**(N-1))
sys.exit()
for i in s:
if i[1]==0 and i[0]==1 and N!=1:
print(-1)
sys.... | import sys
N,M=list(map(int, input().split()))
s=[list(map(int, input().split())) for _ in range(M)]
a=["a" for _ in range(N)]
if len(s)==0 and N==1:
print(0)
sys.exit()
elif len(s)==0:
print(10**(N-1))
sys.exit()
for i in s:
if i[1]==0 and i[0]==1 and N!=1:
print(-1)
sys.ex... | [
"expression.operation.binary.remove",
"variable_access.subscript.index.change",
"call.arguments.change",
"io.output.change",
"expression.operation.unary.add",
"literal.number.integer.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 550,820 | 550,821 | u247680229 | python |
p02761 | n, m = map(int,input().split())
sc = [list(map(int,input().split())) for _ in range(m)]
for i in range(1,10**n):
i = str(i)
flag = True
if len(i) == n:
for j in range(m):
if i[sc[j][0]-1] != str(sc[j][1]):
flag = False
if flag:
print(i)
qu... | n, m = map(int,input().split())
sc = [list(map(int,input().split())) for _ in range(m)]
for i in range(10**n):
i = str(i)
flag = True
if len(i) == n:
for j in range(m):
if i[sc[j][0]-1] != str(sc[j][1]):
flag = False
if flag:
print(i)
quit... | [
"call.arguments.change"
] | 550,822 | 550,823 | u197968862 | python |
p02761 | n, m = map(int, input().split())
sc = [list(map(int, input().split())) for i in range(m)]
for i in range(0, 10**n):
if len(str(i)) == n and all(str(i)[s-1] == str(c) for j in sc):
print(i)
break
else:
print(-1) | n, m = map(int, input().split())
sc = [list(map(int, input().split())) for i in range(m)]
for i in range(0, 10**n):
if len(str(i)) == n and all(str(i)[s-1] == str(c) for s,c in sc):
print(i)
break
else:
print(-1) | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 550,831 | 550,832 | u118760114 | python |
p02761 | n, m = map(int, input().split())
ans = [-1]*n
a = 0
for i in range(m):
s, c = map(int, input().split())
if s == 1 and c == 0 and n != 1:
a = -1
elif ans[s-1] not in [-1, c]:
a = -1
else:
ans[s-1] = c
if a == -1:
print(a)
else:
b = ""
if ans[0] == -1 and n != 1:
... | n, m = map(int, input().split())
ans = [-1]*n
a = 0
for i in range(m):
s, c = map(int, input().split())
if s == 1 and c == 0 and n != 1:
a = -1
elif ans[s-1] not in [-1, c]:
a = -1
else:
ans[s-1] = c
if a == -1:
print(a)
else:
b = ""
if ans[0] == -1 and n != 1:
... | [
"literal.number.integer.change",
"assignment.value.change"
] | 550,835 | 550,836 | u085910248 | python |
p02761 | N, M = map(int, input().split(' '))
if M == 0:
if N == 1:
print(0)
else:
print('1', '0' * (N - 1))
else:
is_end = False
rst = [''] * N
for i in range(M):
s, c = input().split(' ')
idx = int(s) - 1
if idx == 0 and N != 1 and c == '0':
print(-1)
... | N, M = map(int, input().split(' '))
if M == 0:
if N == 1:
print(0)
else:
print('1', '0' * (N - 1), sep='')
else:
is_end = False
rst = [''] * N
for i in range(M):
s, c = input().split(' ')
idx = int(s) - 1
if idx == 0 and N != 1 and c == '0':
print(... | [
"call.arguments.add"
] | 550,878 | 550,879 | u418149936 | python |
p02761 | N, M = map(int, input().split(' '))
if M == 0:
if N == 1:
print(0)
else:
print('1', '0' * (N - 1), sep='')
else:
rst = [''] * N
is_end = False
for i in range(M):
s, c = input().split(' ')
idx = int(s) - 1
if idx == 0 and N != 1 and c == '1':
print(... | N, M = map(int, input().split(' '))
if M == 0:
if N == 1:
print(0)
else:
print('1', '0' * (N - 1), sep='')
else:
rst = [''] * N
is_end = False
for i in range(M):
s, c = input().split(' ')
idx = int(s) - 1
if idx == 0 and N != 1 and c == '0':
print(... | [
"literal.string.change",
"control_flow.branch.if.condition.change"
] | 550,880 | 550,881 | u418149936 | python |
p02761 | #
# abc157 c
#
import sys
from io import StringIO
import unittest
class TestClass(unittest.TestCase):
def assertIO(self, input, output):
stdout, stdin = sys.stdout, sys.stdin
sys.stdout, sys.stdin = StringIO(), StringIO(input)
resolve()
sys.stdout.seek(0)
out = sys.stdout.r... | #
# abc157 c
#
import sys
from io import StringIO
import unittest
class TestClass(unittest.TestCase):
def assertIO(self, input, output):
stdout, stdin = sys.stdout, sys.stdin
sys.stdout, sys.stdin = StringIO(), StringIO(input)
resolve()
sys.stdout.seek(0)
out = sys.stdout.r... | [] | 550,931 | 550,932 | u481250941 | python |
p02761 | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 7 17:11:27 2020
@author: liang
"""
N, M = map(int, input().split())
ans = [-1]*N
res = 0
for i in range(M):
s, c = map(int, input().split())
if s == 1 and c == 0 and N != 1:
print(-1)
break
if ans[s-1] == -1 or ans[s-1] == c:
ans[s-1... | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 7 17:11:27 2020
@author: liang
"""
N, M = map(int, input().split())
ans = [-1]*N
res = 0
for i in range(M):
s, c = map(int, input().split())
if s == 1 and c == 0 and N != 1:
print(-1)
break
if ans[s-1] == -1 or ans[s-1] == c:
ans[s-1... | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 550,937 | 550,938 | u628285938 | python |
p02761 | N,M=map(int, input().split())
SC=[list(map(int, input().split())) for _ in range(M)]
num=[-1]*N
for sc in SC:
s,c=sc[0],sc[1]
if s==1 and c==0 and N>1:
print(-1)
exit()
elif num[s-1]==c or num[s-1]==-1:
num[s-1]=c
else:
print(-1)
exit()
if N==3:
if num[0]==-1:
num[0]=1
if num[1]==-1:
num[1]=0
i... | N,M=map(int, input().split())
SC=[list(map(int, input().split())) for _ in range(M)]
num=[-1]*N
for sc in SC:
s,c=sc[0],sc[1]
if s==1 and c==0 and N>1:
print(-1)
exit()
elif num[s-1]==c or num[s-1]==-1:
num[s-1]=c
else:
print(-1)
exit()
if N==3:
if num[0]==-1:
num[0]=1
if num[1]==-1:
num[1]=0
i... | [
"literal.number.integer.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change",
"assignment.variable.change"
] | 550,952 | 550,953 | u608178601 | python |
p02761 | n,m = map(int,input().split())
done = [0]*n
ans = [0]*n
for i in range(m):
s,c = map(int,input().split())
if done[s-1] != 0 and ans[s-1] != c:
print(-1)
exit()
elif s == n and c == 0:
print(-1)
exit()
else:
done[s-1] = 1
ans[s-1] = c
ans_f = str()
for j in ans:
ans_f += str(j)
if n>1 a... | n,m = map(int,input().split())
done = [0]*n
ans = [0]*n
for i in range(m):
s,c = map(int,input().split())
if done[s-1] != 0 and ans[s-1] != c:
print(-1)
exit()
elif n != 1 and s == 1 and c == 0:
print(-1)
exit()
else:
done[s-1] = 1
ans[s-1] = c
ans_f = str()
for j in ans:
ans_f += str(... | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"identifier.replace.remove",
"literal.replace.add"
] | 550,960 | 550,959 | u624613992 | python |
p02761 | N, M = map(int, input().split())
s = [0] * M
c = [0] * M
for i in range(M):
s[i], c[i] = map(int, input().split())
ran = []
for i in range(10 ** (N - 1), 10 ** N):
ran.append(i)
if N == 1:
ran.append(0)
minimum = 10 ** N
for r in ran:
st = str(r)
ok = True
for j in range(M):
if st[s[j... | N, M = map(int, input().split())
s = [0] * M
c = [0] * M
for i in range(M):
s[i], c[i] = map(int, input().split())
ran = []
for i in range(10 ** (N - 1), 10 ** N):
ran.append(i)
if N == 1:
ran.append(0)
ran.sort()
minimum = 10 ** N
for r in ran:
st = str(r)
ok = True
for j in range(M):
... | [
"call.add"
] | 550,967 | 550,968 | u364555831 | python |
p02761 | N, M = map(int, input().split())
s = [0] * M
c = [0] * M
for i in range(M):
s[i], c[i] = map(int, input().split())
ran = []
for i in range(10 ** (N - 1), 10 ** N):
ran.append(i)
if N == 1:
ran.append(0)
minimum = 10 ** N
for r in ran:
st = str(r)
ok = True
for j in range(M):
if st[s[j... | N, M = map(int, input().split())
s = [0] * M
c = [0] * M
for i in range(M):
s[i], c[i] = map(int, input().split())
ran = []
for i in range(10 ** (N - 1), 10 ** N):
ran.append(i)
if N == 1:
ran.append(0)
ran.sort()
minimum = 10 ** N
for r in ran:
st = str(r)
ok = True
for j in range(M):
... | [
"call.add",
"identifier.change",
"control_flow.branch.if.condition.change"
] | 550,969 | 550,968 | u364555831 | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.