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 |
|---|---|---|---|---|---|---|---|
p02695 | import sys
sys.setrecursionlimit(10 ** 6)
N, M, Q = map(int, input().split())
Q = [list(map(int,input().split())) for _ in range(Q)]
ans = 0
A = []
def dfs():
global A
if len(A) == N:
return
global ans
if len(A) == 0:
start = 0
else:
start = A[-1]
for i in range(start, M ... | import sys
sys.setrecursionlimit(10 ** 6)
N, M, Q = map(int, input().split())
Q = [list(map(int,input().split())) for _ in range(Q)]
ans = 0
A = []
def dfs():
global A
if len(A) == N:
return
global ans
if len(A) == 0:
start = 1
else:
start = A[-1]
for i in range(start, ... | [
"literal.number.integer.change",
"assignment.value.change"
] | 440,337 | 440,338 | u981931040 | python |
p02695 | # 全探索の気持ちが芽生える なにを全探索する?
# Qだと2^50なので無理になる、
# Nをしたいが10^10では?と無理になる
# と思いきや条件からA[i-1]<=A[i]なのでだいぶ減りそうとなる
# 計算量の見積もりがぜんぜんできないがたぶんいけるとなる
from collections import deque
n, m, q = map(int, input().split())
queries = []
for _ in range(q):
queries.append(tuple(map(int, input().split())))
queue = deque()
for i in range(1, ... | # 全探索の気持ちが芽生える なにを全探索する?
# Qだと2^50なので無理になる、
# Nをしたいが10^10では?と無理になる
# と思いきや条件からA[i-1]<=A[i]なのでだいぶ減りそうとなる
# 計算量の見積もりがぜんぜんできないがたぶんいけるとなる
from collections import deque
n, m, q = map(int, input().split())
queries = []
for _ in range(q):
queries.append(tuple(map(int, input().split())))
queue = deque()
for i in range(1, ... | [
"variable_access.subscript.index.change",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change",
"expression.operation.unary.add"
] | 440,354 | 440,355 | u445624660 | python |
p02695 | N, M, Q = map(int, input().split())
A = []
for i in range(Q):
A.append(list(map(int, input().split())))
def calc(B, n):
ans = 0
if len(B) < N:
for i in range(n, M + 1):
ans = max(ans, calc(B + [i], i))
return ans
else:
for j in range(Q):
if B[A[j][1]-1] - B[A[j][0]-1] == A[j][2]:
... | N, M, Q = map(int, input().split())
A = []
for i in range(Q):
A.append(list(map(int, input().split())))
def calc(B, n):
ans = 0
#not enough length
if len(B) < N:
for i in range(n, M + 1):
ans = max(ans, calc(B + [i], i))
#enough length
else:
#print("B:", B)
for j in range(Q):
if B[... | [] | 440,362 | 440,363 | u364555831 | python |
p02695 | def backtrack(nums, N, cur_state, result):
if len(cur_state) == N:
result.append(cur_state[:])
else:
for i in range(len(nums)):
cur_state.append(nums[i])
backtrack(nums[i:], N, cur_state, result)
cur_state.pop()
def solve():
N,M,Q = [int(i) for i in input... | def backtrack(nums, N, cur_state, result):
if len(cur_state) == N:
result.append(cur_state[:])
else:
for i in range(len(nums)):
cur_state.append(nums[i])
backtrack(nums[i:], N, cur_state, result)
cur_state.pop()
def solve():
N,M,Q = [int(i) for i in input... | [
"identifier.replace.add",
"literal.replace.remove",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 440,373 | 440,374 | u439619952 | python |
p02695 | import sys
N, M, Q = map(int, input().split())
abcd = [tuple(map(int, sys.stdin.readline().split())) for _ in range(Q)]
ans = 0
done = set()
todo = [(i,) for i in range(1, M)]
while todo:
A = todo.pop()
done.add(A)
if len(A) == N:
total = 0
for a, b, c, d in abcd:
if A[b-1] - A[a... | import sys
N, M, Q = map(int, input().split())
abcd = [tuple(map(int, sys.stdin.readline().split())) for _ in range(Q)]
ans = 0
done = set()
todo = [(i,) for i in range(1, M + 1)]
while todo:
A = todo.pop()
done.add(A)
if len(A) == N:
total = 0
for a, b, c, d in abcd:
if A[b-1] -... | [
"control_flow.loop.range.bounds.upper.change",
"assignment.change"
] | 440,392 | 440,393 | u553987207 | python |
p02695 | # coding: utf-8
import itertools
def main():
n, m, q = map(int, input().split())
matrix = []
for _ in range(q):
row = list(map(int, input().split()))
matrix.append(row)
# print(matrix)
A = list(range(1, m))
ans = 0
for tmp_A in itertools.combinations_with_replacement(A, n):
... | # coding: utf-8
import itertools
def main():
n, m, q = map(int, input().split())
matrix = []
for _ in range(q):
row = list(map(int, input().split()))
matrix.append(row)
# print(matrix)
A = list(range(1, m+1))
ans = 0
for tmp_A in itertools.combinations_with_replacement(A, n):... | [
"control_flow.loop.range.bounds.upper.change",
"assignment.change"
] | 440,417 | 440,418 | u829203929 | python |
p02695 | # coding: utf-8
import itertools
def main():
n, m, q = map(int, input().split())
matrix = []
for _ in range(q):
row = list(map(int, input().split()))
matrix.append(row)
# print(matrix)
A = list(range(1, 11))
ans = 0
for tmp_A in itertools.combinations_with_replacement(A, n):
... | # coding: utf-8
import itertools
def main():
n, m, q = map(int, input().split())
matrix = []
for _ in range(q):
row = list(map(int, input().split()))
matrix.append(row)
# print(matrix)
A = list(range(1, m+1))
ans = 0
for tmp_A in itertools.combinations_with_replacement(A, n):... | [
"assignment.value.change",
"identifier.replace.add",
"literal.replace.remove",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 440,419 | 440,418 | u829203929 | python |
p02694 | from math import factorial as fact
import math
import sys
import itertools
import numpy as np
from collections import Counter
import datetime
#入力:N(int:整数)
def input1():
return int(input())
#入力:N,M(int:整数)
def input2():
return map(int,input().split())
#入力:[n1,n2,...nk](int:整数配列)
def input_array():
return list(ma... | from math import factorial as fact
import math
import sys
import itertools
import numpy as np
from collections import Counter
import datetime
#入力:N(int:整数)
def input1():
return int(input())
#入力:N,M(int:整数)
def input2():
return map(int,input().split())
#入力:[n1,n2,...nk](int:整数配列)
def input_array():
return list(ma... | [
"call.add",
"call.arguments.change",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 440,428 | 440,429 | u602773379 | python |
p02694 | def main():
x = int(input())
c = 100
count = 0
while not c >= x:
c += c * 0.01
count += 1
print(count)
if __name__ == '__main__':
main() | def main():
x = int(input())
c = 100
count = 0
while not c >= x:
c += int(c * 0.01)
count += 1
print(count)
if __name__ == '__main__':
main() | [
"call.add",
"call.arguments.change"
] | 440,432 | 440,433 | u382905693 | python |
p02694 | x = int(input())
n = 100
i = 1
while n < x:
n += n // 100
i += 1
print(i) | x = int(input())
n = 100
i = 1
while n < x:
n += n // 100
i += 1
print(i-1) | [
"expression.operation.binary.add"
] | 440,434 | 440,435 | u693974737 | python |
p02694 | x = int(input())
cnt = 0
res = 100
while res <= x:
res = res * 1.01
cnt += 1
print(cnt)
| x = int(input())
cnt = 0
res = 100
while res < x:
res = int(res * 1.01)
cnt += 1
print(cnt)
| [
"expression.operator.compare.change",
"control_flow.loop.condition.change",
"call.add",
"call.arguments.change"
] | 440,436 | 440,437 | u047197186 | python |
p02694 | x=int(input())
a=100
y=0
while a<=x:
a=a*1.01//1
y+=1
print(y) | x=int(input())
a=100
y=0
while a<x:
a=(a*1.01)//1
y+=1
print(y) | [
"expression.operator.compare.change",
"control_flow.loop.condition.change"
] | 440,438 | 440,439 | u098588273 | python |
p02694 | x=int(input())
price=100
yr=0
while price<x:
price=price*1.01
yr+=1
print(yr) | x=int(input())
price=100
yr=0
while price<x:
price=price*1.01
price=int(price)
yr+=1
print(yr) | [
"assignment.add"
] | 440,448 | 440,449 | u834471595 | python |
p02695 | N, M, Q = map(int, input().split())
abcd_list = [list(map(int, input().split())) for _ in range(Q)]
Alist = []
def dfs(array):
if len(array) == N:
Alist.append(array)
else:
if not array:
for i in range(M+1):
dfs(array[:] + [i])
else:
for i in range... | N, M, Q = map(int, input().split())
abcd_list = [list(map(int, input().split())) for _ in range(Q)]
Alist = []
def dfs(array):
if len(array) == N:
Alist.append(array)
else:
if not array:
for i in range(1, M+1):
dfs(array[:] + [i])
else:
for i in ra... | [
"call.arguments.add"
] | 440,461 | 440,462 | u762420987 | python |
p02695 | from collections import deque
def calc(nums):
ret = 0
for a, b, c, d in req:
if nums[b - 1] - nums[a - 1] == c:
ret += d
return ret
n, m, q = list(map(int, input().split()))
req = [list(map(int, input().split())) for _ in range(q)]
ans = 0
que = deque()
# [1]~[m]までキューに追加します。実は[1]... | from collections import deque
def calc(nums):
ret = 0
for a, b, c, d in req:
if nums[b - 1] - nums[a - 1] == c:
ret += d
return ret
n, m, q = list(map(int, input().split()))
req = [list(map(int, input().split())) for _ in range(q)]
ans = 0
que = deque()
# [1]~[m]までキューに追加します。実は[1]... | [
"call.arguments.add"
] | 440,470 | 440,471 | u261103969 | python |
p02695 | from sys import stdin, setrecursionlimit
def main():
input = stdin.buffer.readline
n, m, q = map(int, input().split())
abcd = [list(map(int, input().split())) for _ in range(q)]
arr = []
def dfs(num, ai):
if len(ai) == n:
arr.append(ai)
elif len(ai) < n:
f... | from sys import stdin, setrecursionlimit
def main():
input = stdin.buffer.readline
n, m, q = map(int, input().split())
abcd = [list(map(int, input().split())) for _ in range(q)]
arr = []
def dfs(num, ai):
if len(ai) == n:
arr.append(ai)
elif len(ai) < n:
f... | [
"identifier.replace.add",
"literal.replace.remove",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 440,472 | 440,473 | u390727364 | python |
p02695 | N, M, Q = map(int, input().split())
vec = [list(map(int, input().split())) for i in range(Q)]
A = itertools.combinations_with_replacement(range(1,M+1), N)
ans = 0
for a in A:
tmp = 0
for v in vec:
if (a[v[1]-1] - a[v[0]-1]) == v[2]:
tmp += v[3]
if ans < tmp:
ans = tmp
p... | import itertools
N, M, Q = map(int, input().split())
vec = [list(map(int, input().split())) for i in range(Q)]
A = itertools.combinations_with_replacement(range(1,M+1), N)
ans = 0
for a in A:
tmp = 0
for v in vec:
if (a[v[1]-1] - a[v[0]-1]) == v[2]:
tmp += v[3]
if ans < tmp:
ans... | [] | 440,491 | 440,492 | u941644149 | python |
p02695 | # 重複組み合わせの全列挙
import itertools
# n+m-1個からn個を選ぶ組み合わせ
n, m, q = map(int, input().split())
seq = list(range(n+m-1))
p = list(itertools.combinations(seq, n))
a = [0] * q
b = [0] * q
c = [0] * q
d = [0] * q
for i in range(q):
a[i], b[i], c[i], d[i] = map(int, input().split())
res = 0
for i in range(p):
t = [0] ... | # 重複組み合わせの全列挙
import itertools
# n+m-1個からn個を選ぶ組み合わせ
n, m, q = map(int, input().split())
seq = list(range(n+m-1))
p = list(itertools.combinations(seq, n))
a = [0] * q
b = [0] * q
c = [0] * q
d = [0] * q
for i in range(q):
a[i], b[i], c[i], d[i] = map(int, input().split())
res = 0
for i in p:
t = [0] * n
... | [
"call.remove",
"call.arguments.change"
] | 440,500 | 440,501 | u653837719 | python |
p02695 | import itertools
#1~Mと仕切りN枚を適宜並べ、「左にあるかずの個数」を考える。
#1~N+Mの中からN個選ぶ
N,M,Q = [int(hoge) for hoge in input().split()]
L = list(itertools.combinations(range(1,M+N+1),N))
abcd = [[int(hoge) for hoge in input().split()] for q in range(Q)]
curmax = 0
for l in L:
suretu = []
score = 0
for n,k in enumerate(l):#数列を実際に... | import itertools
#1~Mと仕切りN枚を適宜並べ、「左にあるかずの個数」を考える。
#1~N+Mの中からN個選ぶ
N,M,Q = [int(hoge) for hoge in input().split()]
L = list(itertools.combinations(range(1,M+N),N))
abcd = [[int(hoge) for hoge in input().split()] for q in range(Q)]
curmax = 0
for l in L:
suretu = []
score = 0
for n,k in enumerate(l):#数列を実際に生成... | [
"expression.operation.binary.remove"
] | 440,532 | 440,533 | u268516119 | python |
p02695 | import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
n,m,q = map(int,input().split())
item = []
for i in range(q):
a,b,c,d = map(int,input().split())
item.append([a,b,c,d])
a = [0 for i in range(11)]
ans = 0
for i1 i... | import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
n,m,q = map(int,input().split())
item = []
for i in range(q):
a,b,c,d = map(int,input().split())
item.append([a,b,c,d])
a = [0 for i in range(11)]
ans = 0
for i1 i... | [
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove"
] | 440,536 | 440,537 | u379142263 | python |
p02695 | import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
n,m,q = map(int,input().split())
item = []
for i in range(q):
a,b,c,d = map(int,input().split())
item.append([a,b,c,d])
a = [0 for i in range(11)]
ans = 0
for i1 i... | import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
n,m,q = map(int,input().split())
item = []
for i in range(q):
a,b,c,d = map(int,input().split())
item.append([a,b,c,d])
a = [0 for i in range(11)]
ans = 0
for i1 i... | [
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove"
] | 440,538 | 440,537 | u379142263 | python |
p02695 | n,m,q=map(int,input().split(" "))
arr=[list(map(int, input().split(" "))) for i in range(q)]
ans=0
for i1 in range(1,m+1):
for i2 in range(i1,m+1):
for i3 in range(i2, m+1):
for i4 in range(i3, m+1):
for i5 in range(i4, m+1):
for i6 in range(i5, m+1):
for i7 in range(i6, m+1):
for i8 in rang... | n,m,q=map(int,input().split(" "))
arr=[list(map(int, input().split(" "))) for i in range(q)]
ans=0
for i1 in range(1,m+1):
for i2 in range(i1,m+1):
for i3 in range(i2, m+1):
for i4 in range(i3, m+1):
for i5 in range(i4, m+1):
for i6 in range(i5, m+1):
for i7 in range(i6, m+1):
for i8 in rang... | [] | 440,545 | 440,546 | u273038590 | python |
p02695 | from itertools import combinations_with_replacement
def main():
n_ints, max_int, n_queries = map(int, input().split())
queries = [list(map(int, input().split())) for _ in range(n_queries)]
possible_sequences = combinations_with_replacement(range(1, max_int+1), n_ints)
max_score = 0
for sequence... | from itertools import combinations_with_replacement
def main():
n_ints, max_int, n_queries = map(int, input().split())
queries = [list(map(int, input().split())) for _ in range(n_queries)]
possible_sequences = combinations_with_replacement(range(1, max_int+1), n_ints)
max_score = 0
for sequence... | [
"identifier.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change"
] | 440,548 | 440,549 | u764956288 | python |
p02695 | N, M ,Q = map(int, input().aplist())
lists = [list(map(int, input().split())) for i in range(Q)]
ans = 0
def calc_score(A):
score = 0
for a, b, c, d in lists:
if A[b -1] - A[a - 1] == c:
score += d
return score
def dfs(A):
global ans
if len(A) == N:
score = calc_score(A... | N, M, Q = map(int, input().split())
lists = [list(map(int, input().split())) for i in range(Q)]
ans = 0
def calc_score(A):
score = 0
for a, b, c, d in lists:
if A[b - 1] - A[a - 1] == c:
score += d
return score
def dfs(A):
global ans
if len(A) == N:
score = calc_score(A)
... | [
"assignment.value.change",
"identifier.change",
"call.arguments.change"
] | 440,550 | 440,551 | u430336181 | python |
p02695 | n, m, q = [int(e) for e in input().split()]
import itertools as it
abcd=list()
for i in range(q):
abcd.append([int(e) for e in input().split()])
all = it.combinations(range(1,m+1),n)
count=list()
num=0
for i in all:
for j in abcd:
if i[j[1]-1]-i[j[0]-1] == j[2]:
num += j[3]
else:... | n, m, q = [int(e) for e in input().split()]
import itertools as it
abcd=list()
for i in range(q):
abcd.append([int(e) for e in input().split()])
all = it.combinations_with_replacement(range(1,m+1),n)
count=list()
num=0
for i in all:
for j in abcd:
if i[j[1]-1]-i[j[0]-1] == j[2]:
num += j... | [
"assignment.value.change",
"identifier.change"
] | 440,552 | 440,553 | u436173409 | python |
p02695 | N,M,Q=map(int,input().split())
a=[0]*Q
b=[0]*Q
c=[0]*Q
d=[0]*Q
for i in range(Q):
a[i],b[i],c[i],d[i]=map(int,input().split())
a[i]-=1
b[i]-=1 #Aのa[i],b[i]番目を指定したいから-1する。
def score(A):
一つ一つの点数=0
for ai,bi,ci,di in zip(a,b,c,d):
if A[bi]-A[ai]==ci:
一つ一つの点数+=di
return 一つ一つ... | N,M,Q=map(int,input().split())
a=[0]*Q
b=[0]*Q
c=[0]*Q
d=[0]*Q
for i in range(Q):
a[i],b[i],c[i],d[i]=map(int,input().split())
a[i]-=1
b[i]-=1 #Aのa[i],b[i]番目を指定したいから-1する。
def score(A):
一つ一つの点数=0
for ai,bi,ci,di in zip(a,b,c,d):
if A[bi]-A[ai]==ci:
一つ一つの点数+=di
return 一つ一つ... | [
"expression.operation.binary.remove"
] | 440,559 | 440,560 | u122598824 | python |
p02695 | n, m, q = list(map(int, input().split(" ")))
Q = [list(map(int, input().split(" "))) for i in range(q)]
Q = [[i[0] - 1, i[1] - 1, i[2], i[3]] for i in Q]
def calc(arr: list):
return sum([i[3] for i in Q if arr[i[1]] - arr[i[0]] == i[2]])
def get_array(arr: list, num):
if len(arr) == n:
return calc(arr... | n, m, q = list(map(int, input().split(" ")))
Q = [list(map(int, input().split(" "))) for i in range(q)]
Q = [[i[0] - 1, i[1] - 1, i[2], i[3]] for i in Q]
def calc(arr: list):
return sum([i[3] for i in Q if arr[i[1]] - arr[i[0]] == i[2]])
def get_array(arr: list, num):
if len(arr) == n:
return calc(arr... | [
"literal.number.integer.change",
"call.arguments.change",
"io.output.change"
] | 440,575 | 440,576 | u885819526 | python |
p02695 | n,m,q = [int(i) for i in input().split()]
p = []
for i in range(q):
p.append([int(i) for i in input().split()])
dmax = 0
a = [1 for i in range(n)]
while True:
d = 0
for i in range(q):
if a[p[i][1]-1]-a[p[i][0]-1] == p[i][2]:
d += p[i][3]
if d > dmax:
dmax = d
if a[0] == 10:
break
c = 1
l... | n,m,q = [int(i) for i in input().split()]
p = []
for i in range(q):
p.append([int(i) for i in input().split()])
dmax = 0
a = [1 for i in range(n)]
while True:
d = 0
for i in range(q):
if a[p[i][1]-1]-a[p[i][0]-1] == p[i][2]:
d += p[i][3]
if d > dmax:
dmax = d
if a[0] == m:
break
c = 1
l ... | [
"identifier.replace.add",
"literal.replace.remove",
"control_flow.branch.if.condition.change",
"control_flow.loop.condition.change"
] | 440,601 | 440,602 | u831311378 | python |
p02695 | N, M, Q = map(int, input().split())
A = []
B = []
C = []
D = []
for i in range(Q):
a, b, c, d = map(int, input().split())
A.append(a)
B.append(b)
C.append(c)
D.append(d)
def dfs(nums):
if len(nums) == N + 1:
score = 0
for j in range(Q):
if nums[B[j]] - nums[A[j]]... | N, M, Q = map(int, input().split())
A = []
B = []
C = []
D = []
for i in range(Q):
a, b, c, d = map(int, input().split())
A.append(a)
B.append(b)
C.append(c)
D.append(d)
def dfs(nums):
if len(nums) == N + 1:
score = 0
for j in range(Q):
if nums[B[j]] - nums[... | [] | 440,610 | 440,611 | u586639900 | python |
p02695 | import itertools
N, M, Q = map(int, input().split())
a = [0]*Q
b = [0]*Q
c = [0]*Q
d = [0]*Q
for i in range (Q):
a[i], b[i], c[i], d[i] = map(int, input().split())
ans = 0
for A in combinations_with_replacement(range(1, M+1), N):
tmp = 0
for i in range(Q):
if A[b[i]-1] - A[a[i]-1] == c[i]:
... | import itertools
N, M, Q = map(int, input().split())
a = [0]*Q
b = [0]*Q
c = [0]*Q
d = [0]*Q
for i in range(Q):
a[i], b[i], c[i], d[i] = map(int, input().split())
ans = 0
for A in itertools.combinations_with_replacement(range(1, M+1), N):
tmp = 0
for i in range(Q):
if A[b[i]-1] - A[a[i]-1] == c[i]:... | [] | 440,617 | 440,618 | u961288441 | python |
p02695 | N,M,Q = (int(x) for x in input().split())
ABCD = [0]*Q
for T in range(0,Q):
ABCD[T] = [int(x) for x in input().split()]
MaxP = 0
for A1 in range(0,M+1):
for A2 in range(A1,M+1):
if N<=2:
Point = 0
A = [A1,A2]
for TT in range(0,Q):
if A[ABCD[TT][... | N,M,Q = (int(x) for x in input().split())
ABCD = [0]*Q
for T in range(0,Q):
ABCD[T] = [int(x) for x in input().split()]
MaxP = 0
for A1 in range(1,M+1):
for A2 in range(A1,M+1):
if N<=2:
Point = 0
A = [A1,A2]
for TT in range(0,Q):
if A[ABCD[TT][... | [
"literal.number.integer.change",
"call.arguments.change",
"control_flow.loop.range.bounds.lower.change"
] | 440,645 | 440,646 | u955248595 | python |
p02695 | import itertools
n, m, q = list(map(int,input().split()))
sets = [list(map(int,input().split())) for i in range(q)]
print(sets)
mx = 0
nums = list(range(1,m+1))
for h in itertools.combinations_with_replacement(nums,n):
mxtemp = 0
for j in range(q):
a = sets[j][0]
b = sets[j][1]
if list(h... | import itertools
n, m, q = list(map(int,input().split()))
sets = [list(map(int,input().split())) for i in range(q)]
#print(sets)
mx = 0
nums = list(range(1,m+1))
for h in itertools.combinations_with_replacement(nums,n):
mxtemp = 0
for j in range(q):
a = sets[j][0]
b = sets[j][1]
if list(... | [
"call.remove"
] | 440,650 | 440,651 | u449822557 | python |
p02695 | import itertools
n, m, q = list(map(int,input().split()))
sets = [list(map(int,input().split())) for i in range(q)]
mx = 0
nums = list(range(1,m+1))
for h in itertools.combinations_with_replacement(nums,n):
mxtemp = 0
for j in range(q):
a = sets[q][0]
b = sets[q][1]
if list(h)[b-1] - lis... | import itertools
n, m, q = list(map(int,input().split()))
sets = [list(map(int,input().split())) for i in range(q)]
#print(sets)
mx = 0
nums = list(range(1,m+1))
for h in itertools.combinations_with_replacement(nums,n):
mxtemp = 0
for j in range(q):
a = sets[j][0]
b = sets[j][1]
if list(... | [
"assignment.value.change",
"identifier.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change"
] | 440,652 | 440,651 | u449822557 | python |
p02695 | #https://atcoder.jp/contests/abc165/submissions/12672182
#写経
import itertools
import numpy as np
def resolve():
N,M,Q = map(int,input().split())
A = np.array(list(itertools.combinations_with_replacement(range(1,M+1),N)))
s = np.zeros(len(A), np.int32)
for i in range(Q):
a,b,c,d = map(int,input... | #https://atcoder.jp/contests/abc165/submissions/12672182
#写経
import itertools
import numpy as np
def resolve():
N,M,Q = map(int,input().split())
A = np.array(list(itertools.combinations_with_replacement(range(1,M+1),N)))
s = np.zeros(len(A), np.int32)
for i in range(Q):
a,b,c,d = map(int,input(... | [
"call.add"
] | 440,661 | 440,662 | u994935583 | python |
p02695 | import itertools
n,m,q = (int(x) for x in input().split())
l = []
a = [1,2,3,4,5,6,7,8,9,10]
b = []
c = []
d = []
for i in range(q):
l.append([])
l[i]=list(map(int, input().split()))
for i in itertools.combinations_with_replacement(a[:m], r=n):#考えられる数列
b.append(i)
print(b)
for i in ... | import itertools
n,m,q = (int(x) for x in input().split())
l = []
a = [1,2,3,4,5,6,7,8,9,10]
b = []
c = []
d = []
for i in range(q):
l.append([])
l[i]=list(map(int, input().split()))
for i in itertools.combinations_with_replacement(a[:m], r=n):#考えられる数列
b.append(i)
for i in range(len(... | [
"call.remove"
] | 440,663 | 440,664 | u423193302 | python |
p02695 | n,m,q=map(int,input().split())
a=[]
b=[]
c=[]
d=[]
for i in range(q):
A,B,C,D=map(int,input().split())
a.append(A)
b.append(B)
c.append(C)
d.append(D)
ans=0
M=[0,0,0,0,0,0,0,0,0,0,0]
for i in range(n):
M[i]=1
cursor=n
breakflag=0
while True:
ev=0
for i in range(q):
if M[b[i]-1]-M[a[i]-1]==c[i]:
... | n,m,q=map(int,input().split())
a=[]
b=[]
c=[]
d=[]
for i in range(q):
A,B,C,D=map(int,input().split())
a.append(A)
b.append(B)
c.append(C)
d.append(D)
ans=0
M=[0,0,0,0,0,0,0,0,0,0,0]
for i in range(n):
M[i]=1
cursor=n
breakflag=0
while True:
ev=0
for i in range(q):
if M[b[i]-1]-M[a[i]-1]==c[i]:
... | [
"assignment.add"
] | 440,680 | 440,681 | u046158516 | python |
p02695 | n,m,q=map(int,input().split())
a=[]
b=[]
c=[]
d=[]
for i in range(q):
A,B,C,D=map(int,input().split())
a.append(A)
b.append(B)
c.append(C)
d.append(D)
ans=0
M=[0,0,0,0,0,0,0,0,0,0,0]
for i in range(n):
M[i]=1
cursor=n
breakflag=0
while True:
ev=0
for i in range(q):
if M[b[i]-1]-M[a[i]-1]==c[i]:
... | n,m,q=map(int,input().split())
a=[]
b=[]
c=[]
d=[]
for i in range(q):
A,B,C,D=map(int,input().split())
a.append(A)
b.append(B)
c.append(C)
d.append(D)
ans=0
M=[0,0,0,0,0,0,0,0,0,0,0]
for i in range(n):
M[i]=1
cursor=n
breakflag=0
while True:
ev=0
for i in range(q):
if M[b[i]-1]-M[a[i]-1]==c[i]:
... | [
"assignment.add"
] | 440,680 | 440,682 | u046158516 | python |
p02695 | N, M, Q = map(int, input().split())
lst = []
for i in range(Q):
lst.append(list(map(int, input().split())))
import itertools
## product 順番あり 重複あり(全て)
## premutations 順番あり 重複なし
## combinations 順番なし 重複なし
## combinations_with_replacement 順番なし 重複あり
A_pattern = itertools.combinations_with_replacement(range(0, M+1... | N, M, Q = map(int, input().split())
lst = []
for i in range(Q):
lst.append(list(map(int, input().split())))
import itertools
## product 順番あり 重複あり(全て)
## premutations 順番あり 重複なし
## combinations 順番なし 重複なし
## combinations_with_replacement 順番なし 重複あり
A_pattern = itertools.combinations_with_replacement(range(1, M+1... | [
"literal.number.integer.change",
"assignment.value.change",
"call.arguments.change",
"control_flow.loop.range.bounds.lower.change"
] | 440,683 | 440,684 | u658447090 | python |
p02695 | import intertools
N, M, Q = map(int, input().split())
abcd = []
ans = 0
for i in range(Q):
abcd.append(input())
for X in intertools.conbinations_with_replacemant(range(1, M + 1), N):
tmp = 0
for z in abcd:
a, b, c, d = map(int, z.split())
if X[b - 1] - X[a - 1] == c:
tmp += d
ans = max(ans, tmp)
p... | import itertools
N, M, Q = map(int, input().split())
abcd = []
ans = 0
for i in range(Q):
abcd.append(input())
for X in itertools.combinations_with_replacement(range(1, M + 1), N):
tmp = 0
for z in abcd:
a, b, c, d = map(int, z.split())
if X[b - 1] - X[a - 1] == c:
tmp += d
ans = max(ans, tmp)
pri... | [
"identifier.change"
] | 440,686 | 440,687 | u536034761 | python |
p02695 | N, M, Q = map(int, input().split())
abcd = []
ans = 0
for i in range(Q):
abcd.append(input())
for X in intertools.conbinations_with_replacemant(range(1, M + 1), N):
tmp = 0
for z in abcd:
a, b, c, d = map(int, z.split())
if X[b - 1] - X[a - 1] == c:
tmp += d
ans = max(ans, tmp)
print(ans) | import itertools
N, M, Q = map(int, input().split())
abcd = []
ans = 0
for i in range(Q):
abcd.append(input())
for X in itertools.combinations_with_replacement(range(1, M + 1), N):
tmp = 0
for z in abcd:
a, b, c, d = map(int, z.split())
if X[b - 1] - X[a - 1] == c:
tmp += d
ans = max(ans, tmp)
pri... | [
"identifier.change"
] | 440,688 | 440,687 | u536034761 | python |
p02695 | N,M,Q = map(int,input().split())
A = [list(map(int,input().split())) for _ in range(Q)]
def dfs(s):
if len(s) == N:
return[s]
result = []
if s == '':
num = 0
else:
num = int(s[-1])
for i in range(num,M+1):
result.extend(dfs(s+str(i)))
return result
ans = 0
S = dfs... | N,M,Q = map(int,input().split())
A = [list(map(int,input().split())) for _ in range(Q)]
def dfs(s):
if len(s) == N:
return[s]
result = []
if s == '':
num = 0
else:
num = int(s[-1])
for i in range(num,M):
result.extend(dfs(s+str(i)))
return result
ans = 0
S = dfs('... | [
"expression.operation.binary.remove"
] | 440,698 | 440,699 | u514118270 | python |
p02695 | import sys
def main():
input = sys.stdin.readline
N, M, Q = map(int, input().split())
abcd = [tuple(map(int, input().split())) for _ in range(Q)]
stk = [[]]
ans = 0
while stk:
A = stk.pop()
if len(A) < N:
t = A[-1] if len(A) > 0 else 0
for i in range(t, 10... | import sys
def main():
input = sys.stdin.readline
N, M, Q = map(int, input().split())
abcd = [tuple(map(int, input().split())) for _ in range(Q)]
stk = [[]]
ans = 0
while stk:
A = stk.pop()
if len(A) < N:
t = A[-1] if len(A) > 0 else 0
for i in range(t, M)... | [
"identifier.replace.add",
"literal.replace.remove",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 440,721 | 440,722 | u852690916 | python |
p02695 | import itertools;n,m,q,*l=map(int,open(0).read().split());print(max(sum(d for a in[l[j*4:j*4+4]for j in range(q)]if i[b-1]-i[a-1]==c)for i in itertools.combinations_with_replacement(range(m),n))) | import itertools;n,m,q,*l=map(int,open(0).read().split());print(max(sum(d for a,b,c,d in[l[j*4:j*4+4]for j in range(q)]if i[b-1]-i[a-1]==c)for i in itertools.combinations_with_replacement(range(m),n))) | [] | 440,725 | 440,726 | u227082700 | python |
p02695 | import itertools
n,m,q = map(int, input().split())
candidates = [i for i in range(1,m+1)]
a = [0]*q
b = [0]*q
c = [0]*q
d = [0]*q
for i in range(q):
a[i], b[i], c[i], d[i] = map(int, input().split())
max_score = 0
for A in itertools.combinations(candidates, n):
A = list(A)
score = 0
for i in range(q):
if ... | import itertools
n,m,q = map(int, input().split())
candidates = [i for i in range(1,m+1)]
a = [0]*q
b = [0]*q
c = [0]*q
d = [0]*q
for i in range(q):
a[i], b[i], c[i], d[i] = map(int, input().split())
max_score = 0
for A in itertools.combinations_with_replacement(candidates, n):
A = list(A)
score = 0
for i in ... | [
"identifier.change"
] | 440,755 | 440,756 | u279292103 | python |
p02695 | def dfs(n, lower):
if n == N:
return [[]]
else:
res = []
for i in range(lower, M + 1):
for p in dfs(n + 1, i):
res.append([i] + p)
return res
N, M, Q = map(int, input().split())
A, B, C, D = [], [], [], []
for _ in range(Q):
a, b, c, d = map(int,... | def dfs(n, lower):
if n == N:
return [[]]
else:
res = []
for i in range(lower, M + 1):
for p in dfs(n + 1, i):
res.append([i] + p)
return res
N, M, Q = map(int, input().split())
A, B, C, D = [], [], [], []
for _ in range(Q):
a, b, c, d = map(int,... | [
"literal.number.integer.change",
"call.arguments.change"
] | 440,759 | 440,760 | u170839742 | python |
p02695 | import itertools
n, m, q = map(int, input().split())
array = []
for i in range(q):
a = list(map(int, input().split()))
array.append(a)
comb = list(itertools.combinations(range(1, m+1), n))
ans = 0
for i in comb:
score = 0
for a, b, c, d in array:
if i[b-1] - i[a-1] == c:
score += ... | import itertools
n, m, q = map(int, input().split())
array = []
for i in range(q):
a = list(map(int, input().split()))
array.append(a)
comb = list(itertools.combinations_with_replacement(range(1, m+1), n))
ans = 0
for i in comb:
score = 0
for a, b, c, d in array:
if i[b-1] - i[a-1] == c:
... | [
"assignment.value.change",
"identifier.change",
"call.arguments.change"
] | 440,772 | 440,773 | u466143662 | python |
p02695 | import itertools
n, m, q = map(int, input().split())
array = []
for i in range(q):
a = list(map(int, input().split()))
array.append(a)
comb = list(itertools.combinations(range(1, m+1), n))
ans = -1
for i in comb:
score = 0
for a, b, c, d in array:
if i[b-1] - i[a-1] == c:
score +=... | import itertools
n, m, q = map(int, input().split())
array = []
for i in range(q):
a = list(map(int, input().split()))
array.append(a)
comb = list(itertools.combinations_with_replacement(range(1, m+1), n))
ans = 0
for i in comb:
score = 0
for a, b, c, d in array:
if i[b-1] - i[a-1] == c:
... | [
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"expression.operation.unary.remove"
] | 440,774 | 440,773 | u466143662 | python |
p02695 | # 解説を参考に作成
def solve():
N, M, Q = map(int, input().split())
abcd = [[int(i) for i in input().split()] for _ in range(Q)]
def dfs(AA=[0], now_max=0):
A = AA.copy()
if len(A) == N + 1:
new_max = 0
for a, b, c, d in abcd:
if A[b] - A[a] == c:
... | # 解説を参考に作成
def solve():
N, M, Q = map(int, input().split())
abcd = [[int(i) for i in input().split()] for _ in range(Q)]
# AAs first is minmum M.
def dfs(AA=[1], now_max=0):
A = AA.copy()
if len(A) == N + 1:
new_max = 0
for a, b, c, d in abcd:
i... | [
"literal.number.integer.change"
] | 440,781 | 440,782 | u945228737 | python |
p02695 | n, m, q = map(int, input().split(" "))
k = []
for _ in range(q):
k.append(list(map(int, input().split(" "))))
max_score = 0
import itertools
for a in itertools.combinations_with_replacement(range(1, m+1), m):
score = 0
for i in range(q):
if a[k[i][1]-1] - a[k[i][0]-1] == k[i][2]:
score... | n, m, q = map(int, input().split(" "))
k = []
for _ in range(q):
k.append(list(map(int, input().split(" "))))
max_score = 0
import itertools
for a in itertools.combinations_with_replacement(range(1, m+1), n):
score = 0
for i in range(q):
if a[k[i][1]-1] - a[k[i][0]-1] == k[i][2]:
score... | [
"identifier.change",
"call.arguments.change"
] | 440,783 | 440,784 | u573678402 | python |
p02695 | n,m,q = map(int,input().split())
a,b,c,d = [],[],[],[]
ans = 0
A = [1]
for i in range(q):
ai,bi,ci,di = map(int, input().split())
a.append(ai)
b.append(bi)
c.append(ci)
d.append(di)
def dfs(A):
global ans
if n == len(A):
now = 0
for i in range(q):
if A[b[i]-1] -... | n,m,q = map(int,input().split())
a,b,c,d = [],[],[],[]
ans = 0
A = [1]
for i in range(q):
ai,bi,ci,di = map(int, input().split())
a.append(ai)
b.append(bi)
c.append(ci)
d.append(di)
def dfs(A):
global ans
if n == len(A):
now = 0
for i in range(q):
if A[b[i]-1] -... | [
"call.remove"
] | 440,789 | 440,790 | u122184618 | python |
p02695 | from itertools import combinations_with_replacement
N, M, Q = [int(n) for n in input().split()]
X = [[int(n) for n in input().split()] for _ in range(Q)]
ans = []
for A in combinations_with_replacement(range(1, M+1), N):
t = 0
for x in X:
if A[x[1]-1]-A[x[0]-1] == x[2]:
t += x[3]
print(A... | from itertools import combinations_with_replacement
N, M, Q = [int(n) for n in input().split()]
X = [[int(n) for n in input().split()] for _ in range(Q)]
ans = []
for A in combinations_with_replacement(range(1, M+1), N):
t = 0
for x in X:
if A[x[1]-1]-A[x[0]-1] == x[2]:
t += x[3]
ans.app... | [
"call.remove"
] | 440,791 | 440,792 | u761087127 | python |
p02695 | n,m,q=map(int,input().split())
a=[0]*q
b=[0]*q
c=[0]*q
d=[0]*q
A=[]
for i in range(q):
a[i],b[i],c[i],d[i]=map(int,input().split())
def score(A):
sum=0
for (ai,bi,ci,di) in zip(a,b,c,d):
if A[bi-1]-A[ai-1]==ci:
sum+=di
return sum
def fbs(A):
if len(A)==n:
return score(A)
if len(A)>0:
pre_l... | n,m,q=map(int,input().split())
a=[0]*q
b=[0]*q
c=[0]*q
d=[0]*q
A=[]
for i in range(q):
a[i],b[i],c[i],d[i]=map(int,input().split())
def score(A):
sum=0
for (ai,bi,ci,di) in zip(a,b,c,d):
if A[bi-1]-A[ai-1]==ci:
sum+=di
return sum
def fbs(A):
if len(A)==n:
return score(A)
if len(A)>0:
pre_l... | [
"expression.operation.binary.remove"
] | 440,797 | 440,798 | u642668851 | python |
p02695 | N, M, Q = map(int, input().split())
abcd = [list(map(int, input().split())) for _ in range(Q)]
ans = []
import itertools
for A in itertools.combinations_with_replacement(range(1, M+1), N):
tmp = 0
print(A)
for a, b, c, d in abcd:
if A[b-1] - A[a-1] == c:
tmp += d
ans.append(tmp)
pri... | N, M, Q = map(int, input().split())
abcd = [list(map(int, input().split())) for _ in range(Q)]
ans = []
import itertools
for A in itertools.combinations_with_replacement(range(1, M+1), N):
tmp = 0
for a, b, c, d in abcd:
if A[b-1] - A[a-1] == c:
tmp += d
ans.append(tmp)
print(max(ans)) | [
"call.remove"
] | 440,814 | 440,815 | u288147331 | python |
p02695 | N, M, Q = map(int, input().split())
abcd = [list(map(int, input().split())) for _ in range(Q)]
ans = []
import itertools
for A in itertools.combinations_with_replacement(range(1, 10), N):
tmp = 0
for a, b, c, d in abcd:
if A[b-1] - A[a-1] == c:
tmp += d
ans.append(tmp)
print(max(ans)) | N, M, Q = map(int, input().split())
abcd = [list(map(int, input().split())) for _ in range(Q)]
ans = []
import itertools
for A in itertools.combinations_with_replacement(range(1, M+1), N):
tmp = 0
for a, b, c, d in abcd:
if A[b-1] - A[a-1] == c:
tmp += d
ans.append(tmp)
print(max(ans)) | [
"identifier.replace.add",
"literal.replace.remove",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 440,816 | 440,815 | u288147331 | python |
p02695 | N, M, Q = map(int, input().split())
query = []
for _ in range(Q):
query.append(tuple(map(int, input().split())))
res = 0
def solve(A):
global res
if len(A) == N:
tmp = 0
for q in query:
a, b, c, d = q
if A[b - 1] - A[a - 1] == c:
tmp += d
... | N, M, Q = map(int, input().split())
query = []
for _ in range(Q):
query.append(tuple(map(int, input().split())))
res = 0
def solve(A):
global res
if len(A) == N:
tmp = 0
for q in query:
a, b, c, d = q
if A[b - 1] - A[a - 1] == c:
tmp += d
... | [
"identifier.replace.add",
"literal.replace.remove",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 440,821 | 440,822 | u663710122 | python |
p02695 | import itertools
N, M, Q = map(int, input().split())
ABCD = [list(map(int, input().split())) for _ in range(Q)]
# 重複組み合わせ: nHr = n+r-1Cr を考える
ans = 0
R = [i for i in range(1, M+1)]
print(R)
for comb in itertools.combinations_with_replacement(R, N):
temp = 0
for abcd in ABCD:
a, b, c, d = abcd
... | import itertools
N, M, Q = map(int, input().split())
ABCD = [list(map(int, input().split())) for _ in range(Q)]
# 重複組み合わせ: nHr = n+r-1Cr を考える
ans = 0
R = [i for i in range(1, M+1)]
# print(R)
for comb in itertools.combinations_with_replacement(R, N):
temp = 0
for abcd in ABCD:
a, b, c, d = abcd
... | [
"call.remove"
] | 440,850 | 440,851 | u357949405 | python |
p02695 | import itertools
N, M, Q = map(int, input().split())
ABCD = [list(map(int, input().split())) for _ in range(Q)]
ans = 0
R = [i for i in range(1, M+1)]
# print(R)
for comb in itertools.combinations(R, N):
# print(comb)
temp = 0
for abcd in ABCD:
a, b, c, d = abcd
if comb[b-1] - comb[a-1] ==... | import itertools
N, M, Q = map(int, input().split())
ABCD = [list(map(int, input().split())) for _ in range(Q)]
# 重複組み合わせ: nHr = n+r-1Cr を考える
ans = 0
R = [i for i in range(1, M+1)]
# print(R)
for comb in itertools.combinations_with_replacement(R, N):
temp = 0
for abcd in ABCD:
a, b, c, d = abcd
... | [
"identifier.change"
] | 440,852 | 440,851 | u357949405 | python |
p02695 | import itertools
N, M, Q = map(int, input().split())
a = []
b = []
c = []
d = []
for i in range(Q):
ai, bi, ci, di = map(int, input().split())
a.append(ai)
b.append(bi)
c.append(ci)
d.append(di)
A = [i for i in range(1, M+1)] # [1, 2, 3, 4, ... M]
A_pattern = list(itertools.combinations_with_r... | import itertools
N, M, Q = map(int, input().split())
a = []
b = []
c = []
d = []
for i in range(Q):
ai, bi, ci, di = map(int, input().split())
a.append(ai)
b.append(bi)
c.append(ci)
d.append(di)
A = [i for i in range(1, M+1)] # [1, 2, 3, 4, ... M]
A_pattern = list(itertools.combinations_with_r... | [
"assignment.value.change",
"identifier.change",
"call.arguments.change"
] | 440,856 | 440,857 | u845620905 | python |
p02695 | import itertools
N, M, Q = map(int, input().split())
a = []
b = []
c = []
d = []
for i in range(Q):
ai, bi, ci, di = map(int, input().split())
a.append(ai)
b.append(bi)
c.append(ci)
d.append(di)
A = [i for i in range(1, M+1)] # [1, 2, 3, 4, ... M]
A_pattern = list(itertools.combinations_with_r... | import itertools
N, M, Q = map(int, input().split())
a = []
b = []
c = []
d = []
for i in range(Q):
ai, bi, ci, di = map(int, input().split())
a.append(ai)
b.append(bi)
c.append(ci)
d.append(di)
A = [i for i in range(1, M+1)] # [1, 2, 3, 4, ... M]
A_pattern = list(itertools.combinations_with_r... | [
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 440,858 | 440,857 | u845620905 | python |
p02695 | n, m, q = map(int, input().split())
a = [0] * 55; b = [0] * 55; c = [0] * 55; d = [0] * 55
for i in range(q):
a[i], b[i], c[i], d[i] = map(int, input().split())
def socer(A):
now = 0
for i in range(q):
if A[b[i]-1] - A[a[i]-1] == c[i]: now += d[i]
return now
def dfs(A):
print(A)
if l... | n, m, q = map(int, input().split())
a = [0] * 55; b = [0] * 55; c = [0] * 55; d = [0] * 55
for i in range(q):
a[i], b[i], c[i], d[i] = map(int, input().split())
def socer(A):
now = 0
for i in range(q):
if A[b[i]-1] - A[a[i]-1] == c[i]: now += d[i]
return now
def dfs(A):
# print(A)
if... | [
"call.remove"
] | 440,861 | 440,862 | u861141787 | python |
p02695 | import itertools
N, M, Q = map(int, input().split())
P = [[int(x) for x in input().split()] for _ in range(Q)]
li = [x for x in range(1, M+1)]
Com = itertools.combinations(li, N)
ans=0
for com in Com:
reg=0
for a,b,c,d in P:
if com[b-1] - com[a-1] == c:
reg += d
ans = max(reg, ans)
pri... | import itertools
N, M, Q = map(int, input().split())
P = [[int(x) for x in input().split()] for _ in range(Q)]
li = [x for x in range(1, M+1)]
Com = itertools.combinations_with_replacement(li, N)
ans=0
for com in Com:
reg=0
for a,b,c,d in P:
if com[b-1] - com[a-1] == c:
reg += d
ans = ... | [
"assignment.value.change",
"identifier.change"
] | 440,863 | 440,864 | u461833298 | python |
p02695 | N, M, Q = list(map(int, input().split()))
a = []
b = []
c = []
d = []
for _ in range(Q):
abcd = list(map(int, input().split()))
a.append(abcd[0]-1)
b.append(abcd[1]-1)
c.append(abcd[2])
d.append(abcd[3])
import itertools
ans = 0
for p in itertools.combinations_with_replacement([i for i in range(1, ... | N, M, Q = list(map(int, input().split()))
a = []
b = []
c = []
d = []
for _ in range(Q):
abcd = list(map(int, input().split()))
a.append(abcd[0]-1)
b.append(abcd[1]-1)
c.append(abcd[2])
d.append(abcd[3])
import itertools
ans = 0
for p in itertools.combinations_with_replacement([i for i in range(1, ... | [
"call.remove"
] | 440,865 | 440,866 | u069867812 | python |
p02695 | n,m,q = map(int,input().split())
a = [0] * q
b = [0] * q
c = [0] * q
d = [0] * q
for i in range(q):
a[i], b[i], c[i], d[i] = map(int, input().split())
mm = [0]*m
for k in range(1,m+1,1):
mm[k-1]=k
A = list(itertools.combinations_with_replacement(mm, n))
su = 0
ans = 0
for x in range(len(A)):
l=A[x]
... | import itertools
n,m,q = map(int,input().split())
a = [0] * q
b = [0] * q
c = [0] * q
d = [0] * q
for i in range(q):
a[i], b[i], c[i], d[i] = map(int, input().split())
mm = [0]*m
for k in range(1,m+1,1):
mm[k-1]=k
A = list(itertools.combinations_with_replacement(mm, n))
su = 0
ans = 0
for x in range(len(A)... | [] | 440,873 | 440,874 | u534338602 | python |
p02695 | import itertools
n,m,q = map(int,input().split())
a = [0]*q
b = [0]*q
c = [0]*q
d = [0]*q
for i in range(q):
a[i],b[i],c[i],d[i] = map(int,input().split())
ans = 0
for A in itertools.combinations_with_replacement(range(1,m+1),n):
cnt = 0
for i in range(q):
if A[b[i]-1] - A[a[i]-1] == c[i]:
... | import itertools
n,m,q = map(int,input().split())
a = [0]*q
b = [0]*q
c = [0]*q
d = [0]*q
for i in range(q):
a[i],b[i],c[i],d[i] = map(int,input().split())
ans = 0
for A in itertools.combinations_with_replacement(range(1,m+1),n):
cnt = 0
for i in range(q):
if A[b[i]-1] - A[a[i]-1] == c[i]:
... | [
"assignment.value.change",
"identifier.change",
"call.arguments.change"
] | 440,882 | 440,883 | u145600939 | python |
p02695 | n,m,q = map(int,input().split())
a = [0]*q
b = [0]*q
c = [0]*q
d = [0]*q
for i in range(n):
a[i],b[i],c[i],d[i] = map(int,input().split())
a[i] -= 1
b[i] -= 1
A = [0]*n
ans = 0
def dfs(h):
global ans
if h == n-1:
cnt = 0
for i in range(q):
if A[b[i]] - A[a[i]] == c[i]:
... | n,m,q = map(int,input().split())
a = [0]*q
b = [0]*q
c = [0]*q
d = [0]*q
for i in range(q):
a[i],b[i],c[i],d[i] = map(int,input().split())
a[i] -= 1
b[i] -= 1
A = [0]*n
ans = 0
def dfs(h):
global ans
if h == n-1:
cnt = 0
for i in range(q):
if A[b[i]] - A[a[i]] == c[i]:
... | [
"identifier.change",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 440,884 | 440,885 | u145600939 | python |
p02695 | from itertools import combinations_with_replacement
N, M, Q = map(int, input().split())
query = tuple(tuple(map(int, input().split())) for _ in range(Q))
ans = 0
for comb in combinations_with_replacement(range(1, M+1), N):
print(comb)
score = 0
for a, b, c, d in query:
if comb[b-1] - comb[a-1] ==... | from itertools import combinations_with_replacement
N, M, Q = map(int, input().split())
query = tuple(tuple(map(int, input().split())) for _ in range(Q))
ans = 0
for comb in combinations_with_replacement(range(1, M+1), N):
score = 0
for a, b, c, d in query:
if comb[b-1] - comb[a-1] == c:
... | [
"call.remove"
] | 440,890 | 440,891 | u707498674 | python |
p02695 | from itertools import combinations_with_replacement
N, M, Q = map(int, input().split())
query = tuple(tuple(map(int, input().split())) for _ in range(Q))
ans = 0
for comb in combinations_with_replacement(range(1, 11), N):
score = 0
for a, b, c, d in query:
if comb[b-1] - comb[a-1] == c:
s... | from itertools import combinations_with_replacement
N, M, Q = map(int, input().split())
query = tuple(tuple(map(int, input().split())) for _ in range(Q))
ans = 0
for comb in combinations_with_replacement(range(1, M+1), N):
score = 0
for a, b, c, d in query:
if comb[b-1] - comb[a-1] == c:
... | [
"identifier.replace.add",
"literal.replace.remove",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 440,892 | 440,891 | u707498674 | python |
p02695 | n,m,q=map(int,input().split())
abcd=[]
x=[1]
for i in range(q):
abcd.append(list(map(int,input().split())))
ans=0
def dfs(s):
global ans
if(len(s)==n):
t=0
for a,b,c,d in abcd:
if(s[b-1]-s[a-1]==c):
t+=d
ans=max(t,ans)
return
p=s[-1]
print... | n,m,q=map(int,input().split())
abcd=[]
x=[1]
for i in range(q):
abcd.append(list(map(int,input().split())))
ans=0
def dfs(s):
global ans
if(len(s)==n):
t=0
for a,b,c,d in abcd:
if(s[b-1]-s[a-1]==c):
t+=d
ans=max(t,ans)
return
p=s[-1]
while... | [
"call.remove"
] | 440,902 | 440,903 | u614162316 | python |
p02695 | from itertools import combinations_with_replacement
N,M,Q = map(int,input().split())
A = []
for i in range(Q):
b = list(map(int,input().split()))
A.append(b)
T = range(M+1)
K = list(combinations_with_replacement(T,N))
ans = 0
for line in K:
total = 0
for combi in A:
if line[combi[1]-1] - line[... | from itertools import combinations_with_replacement
N,M,Q = map(int,input().split())
A = []
for i in range(Q):
b = list(map(int,input().split()))
A.append(b)
T = range(1,M+1)
K = list(combinations_with_replacement(T,N))
ans = 0
for line in K:
total = 0
for combi in A:
if line[combi[1]-1] - lin... | [
"call.arguments.add"
] | 440,908 | 440,909 | u454093752 | python |
p02695 | def make(n, A, M):
if n == 0:
A_list.append(A)
return
for i in range(A[-1], M+1):
make(n-1, A+[i], M)
n, M, q = map(int, input().split())
A_list = []
for i in range(M+1):
make(n, [i], M)
# print(A_list)
abcd = [list(map(int, input().split())) for _ in range(q)]
ans = 0
for i in A_l... | def make(n, A, M):
if n == 0:
A_list.append(A)
return
for i in range(A[-1], M+1):
make(n-1, A+[i], M)
n, M, q = map(int, input().split())
A_list = []
for i in range(1, M+1):
make(n, [i], M)
# print(A_list)
abcd = [list(map(int, input().split())) for _ in range(q)]
ans = 0
for i in ... | [
"call.arguments.add"
] | 440,913 | 440,914 | u102126195 | python |
p02695 | n,m,q = map(int,input().split())
a,b,c,d=[0]*q,[0]*q,[0]*q,[0]*q
for i in range(q):
a[i],b[i],c[i],d[i] = map(int,input().split())
ans =0
from itertools import combinations_with_replacement
for i in combinations_with_replacement(range(1,m+1), n):
print(i)
tmp=0
for j in range(q):
if c[j] == i... | n,m,q = map(int,input().split())
a,b,c,d=[0]*q,[0]*q,[0]*q,[0]*q
for i in range(q):
a[i],b[i],c[i],d[i] = map(int,input().split())
ans =0
from itertools import combinations_with_replacement
for i in combinations_with_replacement(range(1,m+1), n):
tmp=0
for j in range(q):
if c[j] == i[b[j]-1] - i[... | [
"call.remove"
] | 440,917 | 440,918 | u959390099 | python |
p02695 | N, M, Q = map(int, input().split())
B = [tuple(int(i) for i in input().split()) for i in range(Q)]
A = [1]*N
def recur(A=A, index=0, lim=M):
if index>len(A)-2:
return
while A[index] <= lim-1:
A[index] += 1
yield A[::-1]
yield from recur(A[:], index+1, A[index])
return
def g... | N, M, Q = map(int, input().split())
B = [tuple(int(i) for i in input().split()) for i in range(Q)]
A = [1]*N
def recur(A=A, index=0, lim=M):
if index>len(A)-2:
return
while A[index] <= lim-1:
A[index] += 1
yield A[::-1]
yield from recur(A[:], index+1, A[index])
return
def g... | [
"call.arguments.add"
] | 440,922 | 440,923 | u166640573 | python |
p02695 | # 重複順列 19C10
from itertools import combinations_with_replacement as cw
n,m,q = map(int, input().split())
a_candidates = cw([i+1 for i in range(m)],m)
fs = [list(map(int, input().split())) for i in range(q)]
def calc(fs,As):
cnt = 0
for a,b,c,d in fs:
a -= 1
b -= 1
if As[b]-As[a] == c: ... | # 重複順列 19C10
from itertools import combinations_with_replacement as cw
n,m,q = map(int, input().split())
a_candidates = cw([i+1 for i in range(m)],n)
fs = [list(map(int, input().split())) for i in range(q)]
def calc(fs,As):
cnt = 0
for a,b,c,d in fs:
a -= 1
b -= 1
if As[b]-As[a] == c: ... | [
"assignment.value.change",
"identifier.change",
"call.arguments.change"
] | 440,926 | 440,927 | u545368057 | python |
p02695 | n,m,q = map(int,input().split())
abcd_list = []
for i in range(q):
abcd_list.append(list(map(int,input().split())))
a = [1]*n
def next_a(a):
if a[-1] != 10:
a[-1] += 1
else:
d = n-1
while d > 0 and a[d] == 10:
d-=1
if d < 0:
return a
a[d] +=... | n,m,q = map(int,input().split())
abcd_list = []
for i in range(q):
abcd_list.append(list(map(int,input().split())))
a = [1]*n
def next_a(a):
if a[-1] != m:
a[-1] += 1
else:
d = n-1
while d > 0 and a[d] == m:
d-=1
if d < 0:
return a
a[d] += 1
... | [
"identifier.replace.add",
"literal.replace.remove",
"control_flow.branch.if.condition.change",
"control_flow.loop.condition.change"
] | 440,937 | 440,938 | u014800961 | python |
p02695 | n,m,q = map(int,input().split())
abcd_list = []
for i in range(q):
abcd_list.append(list(map(int,input().split())))
a = [1]*n
def next_a(a):
if a[-1] != 10:
a[-1] += 1
else:
d = n-1
while d > 0 and a[d] == 10:
d-=1
if d < 0:
return a
a[d] +... | n,m,q = map(int,input().split())
abcd_list = []
for i in range(q):
abcd_list.append(list(map(int,input().split())))
a = [1]*n
def next_a(a):
if a[-1] != m:
a[-1] += 1
else:
d = n-1
while d > 0 and a[d] == m:
d-=1
if d < 0:
return a
a[d] += 1
... | [
"identifier.replace.add",
"literal.replace.remove",
"control_flow.branch.if.condition.change",
"control_flow.loop.condition.change"
] | 440,939 | 440,938 | u014800961 | python |
p02695 | N,M,Q = map(int,input().split())
a = [0]*Q
b = [0]*Q
c = [0]*Q
d = [0]*Q
for i in range(Q):
a[i],b[i],c[i],d[i] = map(int,input().split())
a[i] -= 1 #a,bを0オリジンにそろえる
b[i] -= 1
def score(A):
score = 0
for ai, bi, ci, di in zip(a, b, c, d):
if A[bi] - A[ai] == ci:
score += ci
... | N,M,Q = map(int,input().split())
a = [0]*Q
b = [0]*Q
c = [0]*Q
d = [0]*Q
for i in range(Q):
a[i],b[i],c[i],d[i] = map(int,input().split())
a[i] -= 1 #a,bを0オリジンにそろえる
b[i] -= 1
def score(A):
score = 0
for ai, bi, ci, di in zip(a, b, c, d):
if A[bi] - A[ai] == ci:
score += di
... | [
"identifier.change"
] | 440,942 | 440,943 | u859987056 | python |
p02695 | n,m,q = map(int,input().split())
arr = [list(map(int,input().split())) for _ in range(q)]
ans = 0
for i1 in range(1,m+1):
for i2 in range(i1,m+1):
for i3 in range(i2,m+1):
for i4 in range(i3,m+1):
for i5 in range(i4,m+1):
for i6 in range(i5,m+1):
for i7 in range(6,m+1):
... | n,m,q = map(int,input().split())
arr = [list(map(int,input().split())) for x in range(q)]
ans = 0
for i1 in range(1,m+1):
for i2 in range(i1,m+1):
for i3 in range(i2,m+1):
for i4 in range(i3,m+1):
for i5 in range(i4,m+1):
for i6 in range(i5,m+1):
for i7 in range(i6,m+1):
... | [
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 440,958 | 440,959 | u228303592 | python |
p02695 | n,m,q = map(int,input().split())
arr = [list(map(int,input().split())) for x in range(q)]
ans = 0
for i1 in range(1,m+1):
for i2 in range(i1,m+1):
for i3 in range(i2,m+1):
for i4 in range(i3,m+1):
for i5 in range(i4,m+1):
for i6 in range(i5,m+1):
for i7 in range(6,m+1):
... | n,m,q = map(int,input().split())
arr = [list(map(int,input().split())) for x in range(q)]
ans = 0
for i1 in range(1,m+1):
for i2 in range(i1,m+1):
for i3 in range(i2,m+1):
for i4 in range(i3,m+1):
for i5 in range(i4,m+1):
for i6 in range(i5,m+1):
for i7 in range(i6,m+1):
... | [
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 440,960 | 440,959 | u228303592 | python |
p02695 | n,m,q = map(int,input().split())
arr = [list(map(int,input().split())) for x in range(q)]
ans = 0
for i1 in range(1,m+1):
for i2 in range(i1,m+1):
for i3 in range(i2,m+1):
for i4 in range(i4,m+1):
for i5 in range(i4,m+1):
for i6 in range(i5,m+1):
for i7 in range(6,m+1):
... | n,m,q = map(int,input().split())
arr = [list(map(int,input().split())) for x in range(q)]
ans = 0
for i1 in range(1,m+1):
for i2 in range(i1,m+1):
for i3 in range(i2,m+1):
for i4 in range(i3,m+1):
for i5 in range(i4,m+1):
for i6 in range(i5,m+1):
for i7 in range(i6,m+1):
... | [
"identifier.change",
"call.arguments.change",
"control_flow.loop.range.bounds.lower.change",
"control_flow.loop.range.bounds.upper.change"
] | 440,961 | 440,959 | u228303592 | python |
p02695 | def main():
from itertools import combinations_with_replacement
import sys
input = sys.stdin.buffer.readline
N, M, Q = (int(i) for i in input().split())
T = [[int(i) for i in input().split()] for j in range(Q)]
ans = 0
for A in combinations_with_replacement(range(1, M+1), N):
A.sort(... | def main():
from itertools import combinations_with_replacement
import sys
input = sys.stdin.buffer.readline
N, M, Q = (int(i) for i in input().split())
T = [[int(i) for i in input().split()] for j in range(Q)]
ans = 0
for C in combinations_with_replacement(range(1, M+1), N):
A = sor... | [
"identifier.change",
"call.arguments.change"
] | 440,968 | 440,969 | u312025627 | python |
p02695 | def main():
import sys
input = sys.stdin.buffer.readline
N, M, Q = (int(i) for i in input().split())
T = [[int(i) for i in input().split()] for j in range(Q)]
def dfs(A):
cur = 0
if len(A) == N:
for a, b, c, d in T:
if A[b-1] - A[a-1] == c:
... | def main():
import sys
input = sys.stdin.buffer.readline
N, M, Q = (int(i) for i in input().split())
T = [[int(i) for i in input().split()] for j in range(Q)]
def dfs(A):
cur = 0
if len(A) == N:
for a, b, c, d in T:
if A[b-1] - A[a-1] == c:
... | [
"identifier.replace.add",
"literal.replace.remove",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 440,971 | 440,972 | u312025627 | python |
p02695 | # -*- coding: utf-8 -*-
class Combination_with_repetition():
def getPattern(self, arr :list, r :int) -> list:
self._selected=[]
self._all_pattern=[]
self._make(arr,r)
return self._all_pattern
def _make(self, arr :list, r :int):
if r == 0:
se... | # -*- coding: utf-8 -*-
class Combination_with_repetition():
def getPattern(self, arr :list, r :int) -> list:
self._selected=[]
self._all_pattern=[]
self._make(arr,r)
return self._all_pattern
def _make(self, arr :list, r :int):
if r == 0:
se... | [
"assignment.value.change",
"identifier.change",
"call.arguments.change"
] | 440,988 | 440,989 | u530383736 | python |
p02695 | # 視点を変えてやる全探索 実は条件よりAを全列挙することが可能
n, m, q = map(int, input().split())
koho = []
def rec(arr):
if len(arr) == n:
koho.append(arr)
else:
for i in range(arr[-1], m + 1):
nex_arr = arr[:]
nex_arr.append(i)
rec(nex_arr)
for i in range(m + 1):
rec([i])
ans = ... | # 視点を変えてやる全探索 実は条件よりAを全列挙することが可能
# rec, 1からじゃなくて0からにしてたせいか1ケースでWA????
n, m, q = map(int, input().split())
koho = []
def rec(arr):
if len(arr) == n:
koho.append(arr)
else:
for i in range(arr[-1], m + 1):
nex_arr = arr[:]
nex_arr.append(i)
rec(nex_arr)
# こ... | [
"call.arguments.add"
] | 440,998 | 440,999 | u247554097 | python |
p02695 | N,M,Q=map(int,input().split())
L=[]
for i in range(Q):
L.append(list(map(int,input().split())))
L[i][0]-=1
L[i][1]-=1
import itertools
L=list(range(1,M+1))
A=list(itertools.combinations_with_replacement(L,N))
ans=0
for i in A:
tmp=0
for a,b,c,d in L:
if (i[b]-i[a])==c:
tmp+=d
ans=max(ans,tmp)
pri... | N,M,Q=map(int,input().split())
L=[]
for i in range(Q):
L.append(list(map(int,input().split())))
L[i][0]-=1
L[i][1]-=1
#print(L)
import itertools
R=list(range(1,M+1))#ここで変数Lを使っていた
A=list(itertools.combinations_with_replacement(R,N))
ans=0
#print(L)変数を上書きしていた!!!!!
for i in A:
tmp=0
for a,b,c,d in L:
if (i... | [
"assignment.variable.change",
"identifier.change",
"assignment.value.change",
"call.arguments.change"
] | 441,001 | 441,002 | u506858457 | python |
p02695 | N, M, Q = map(int, input().split())
a = [0 for _ in range(Q)]
b = [0 for _ in range(Q)]
c = [0 for _ in range(Q)]
d = [0 for _ in range(Q)]
for k in range(Q):
a[k], b[k], c[k], d[k] = map(int, input().split())
A = [1 for _ in range(N)]
def point(A):
p = 0
for ai, bi, ci, di in zip(a, b, c, d):
if A[bi-1] - A... | N, M, Q = map(int, input().split())
a = [0 for _ in range(Q)]
b = [0 for _ in range(Q)]
c = [0 for _ in range(Q)]
d = [0 for _ in range(Q)]
for k in range(Q):
a[k], b[k], c[k], d[k] = map(int, input().split())
A = [1 for _ in range(N)]
def point(A):
p = 0
for ai, bi, ci, di in zip(a, b, c, d):
if A[bi-1] - A... | [
"call.remove",
"call.arguments.change"
] | 441,005 | 441,006 | u627600101 | python |
p02695 | n, m, q = map(int, input().split())
abcd = [list(map(int, input().split())) for _ in range(q)]
a,b,c,d = [],[],[],[]
for i in range(q):
a.append(abcd[i][0])
b.append(abcd[i][1])
c.append(abcd[i][2])
d.append(abcd[i][3])
def score(A):
tmp = 0
for ai, bi, ci, di in zip(a, b, c, d):
if A[bi] - A[ai] == ... | n, m, q = map(int, input().split())
abcd = [list(map(int, input().split())) for _ in range(q)]
a,b,c,d = [],[],[],[]
for i in range(q):
a.append(abcd[i][0])
b.append(abcd[i][1])
c.append(abcd[i][2])
d.append(abcd[i][3])
def score(A):
tmp = 0
for ai, bi, ci, di in zip(a, b, c, d):
if A[bi] - A[ai] == ... | [
"call.remove"
] | 441,007 | 441,008 | u935642171 | python |
p02695 | def next_array(array):#辞書式に次の配列を与える関数
s = -1
for x in array[::-1]:
if x < M:
break
else:
s -= 1
#Mより小さい最後の項を取得
if s >= -N:
array[s] += 1#その項を1増やす
if s < -1:
for i in range(s+1,0):#以降の項を全て同じ値に
array[i] = array[s]
print(array)
return array
def score(array, r... | def next_array(array):#辞書式に次の配列を与える関数
s = -1
for x in array[::-1]:
if x < M:
break
else:
s -= 1
#Mより小さい最後の項を取得
if s >= -N:
array[s] += 1#その項を1増やす
if s < -1:
for i in range(s+1,0):#以降の項を全て同じ値に
array[i] = array[s]
return array
def score(array, rules):#点数計算
scr... | [
"call.remove"
] | 441,016 | 441,017 | u923172145 | python |
p02695 | def next_array(array):#辞書式に次の配列を与える関数
s = -1
for x in array[::-1]:
if x < M:
break
else:
s -= 1
#Mより小さい最後の項を取得
if s >= -N:
array[s] += 1#その項を1増やす
if s < -1:
for i in range(s+1,0):#以降の項を全て同じ値に
array[i] = array[s]
print(array)
return array
def score(array, r... | def next_array(array):#辞書式に次の配列を与える関数
s = -1
for x in array[::-1]:
if x < M:
break
else:
s -= 1
#Mより小さい最後の項を取得
if s >= -N:
array[s] += 1#その項を1増やす
if s < -1:
for i in range(s+1,0):#以降の項を全て同じ値に
array[i] = array[s]
return array
def score(array, rules):#点数計算
scr... | [
"call.remove"
] | 441,018 | 441,017 | u923172145 | python |
p02695 | n, m, q = map(int, input().split())
l = []
for i in range(q):
l.append(list(map(int,input().split())))
t = [1]*(n+1)
ans = 0
while t[0] == 1:
s = 0
for i in range(q):
if t[l[i][1]]-t[l[i][0]] == l[i][2]:
s += l[i][3]
ans = max(ans, s)
k = n
while t[k] == m and n >= 1:
... | n, m, q = map(int, input().split())
l = []
for i in range(q):
l.append(list(map(int,input().split())))
t = [1]*(n+1)
ans = 0
while t[0] == 1:
s = 0
for i in range(q):
if t[l[i][1]]-t[l[i][0]] == l[i][2]:
s += l[i][3]
ans = max(ans, s)
k = n
while t[k] == m and k >= 1:
... | [
"identifier.change",
"control_flow.loop.condition.change"
] | 441,035 | 441,036 | u247442310 | python |
p02695 | #!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return [LIST() for _ in range(n)]
# 昇順列の巡回
def ascending(N, M):
... | #!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return [LIST() for _ in range(n)]
# 昇順列の巡回
def ascending(N, M):
... | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 441,039 | 441,040 | u947883560 | python |
p02695 | import itertools
n,m,q = map(int, input().split())
list_ = [list(map(int, input().split())) for _ in range(q)]
num=1
seed = [[i] for i in range(1,m+1)]
while num!=n:
num+=1
tmp_list = []
while seed:
tmp = seed.pop()
for i in range(tmp[-1]+1,m+1):
tmp_list.append(tmp+[i])
seed = tmp_list.copy()
... | import itertools
n,m,q = map(int, input().split())
list_ = [list(map(int, input().split())) for _ in range(q)]
num=1
seed = [[i] for i in range(1,m+1)]
while num!=n:
num+=1
tmp_list = []
while seed:
tmp = seed.pop()
for i in range(tmp[-1],m+1):
tmp_list.append(tmp+[i])
seed = tmp_list.copy()
ma... | [
"expression.operation.binary.remove"
] | 441,041 | 441,042 | u842388336 | python |
p02695 | import sys
sys.setrecursionlimit(10**9)
n,m,q=map(int,input().split())
l=[list(map(int,input().split())) for i in range(q)]
def dfs(a_l):
if len(a_l)==n:
global ans
t_ans=0
for a,b,c,d in l:
a-=1
b-=1
if (a_l[b]-a_l[a]==c):
t_ans+=d
ans=max(ans,t_ans)
return
a_last=... | import sys
sys.setrecursionlimit(10**9)
n,m,q=map(int,input().split())
l=[list(map(int,input().split())) for i in range(q)]
def dfs(a_l):
if len(a_l)==n:
global ans
t_ans=0
for a,b,c,d in l:
a-=1
b-=1
if (a_l[b]-a_l[a]==c):
t_ans+=d
ans=max(ans,t_ans)
return
a_last=... | [
"call.arguments.add"
] | 441,051 | 441,052 | u094191970 | python |
p02695 | import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)
N, M, Q = mapint()
abcd = [list(mapint()) for _ in range(Q)]
from itertools import combinations_with_replacement
lis = range(1, 11)
ans = 0
for l in combinations_with_replacement(li... | import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)
N, M, Q = mapint()
abcd = [list(mapint()) for _ in range(Q)]
from itertools import combinations_with_replacement
lis = range(1, M+1)
ans = 0
for l in combinations_with_replacement(l... | [
"assignment.value.change",
"identifier.replace.add",
"literal.replace.remove",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 441,059 | 441,060 | u054514819 | python |
p02695 | import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)
N, M, Q = mapint()
abcd = [list(mapint()) for _ in range(Q)]
from itertools import combinations_with_replacement
lis = range(1, 10)
ans = 0
for l in combinations_with_replacement(li... | import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)
N, M, Q = mapint()
abcd = [list(mapint()) for _ in range(Q)]
from itertools import combinations_with_replacement
lis = range(1, M+1)
ans = 0
for l in combinations_with_replacement(l... | [
"assignment.value.change",
"identifier.replace.add",
"literal.replace.remove",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 441,061 | 441,060 | u054514819 | python |
p02695 | n, m, q = map(int, input().split())
req = []
[req.append(tuple(map(int, input().split()))) for _ in range(q)]
a = [0 for _ in range(m)]
def check():
res = 0
for i in range(q):
ra, rb, rc, rd = req[i]
if a[rb - 1] - a[ra - 1] == rc:
res += rd
return res
def set_a(idx: int, au: i... | n, m, q = map(int, input().split())
req = []
[req.append(tuple(map(int, input().split()))) for _ in range(q)]
a = [0 for _ in range(n)]
def check():
res = 0
for i in range(q):
ra, rb, rc, rd = req[i]
if a[rb - 1] - a[ra - 1] == rc:
res += rd
return res
def set_a(idx: int, au: i... | [
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 441,068 | 441,069 | u203062059 | python |
p02695 | n, m, q = map(int, input().split())
req = []
[req.append(tuple(map(int, input().split()))) for _ in range(q)]
a = [0 for _ in range(m)]
def check():
res = 0
for i in range(q):
ra, rb, rc, rd = req[i]
if a[rb - 1] - a[ra - 1] == rc:
res += rd
return res
def set_a(idx: int, au: i... | n, m, q = map(int, input().split())
req = []
[req.append(tuple(map(int, input().split()))) for _ in range(q)]
a = [0 for _ in range(n)]
def check():
res = 0
for i in range(q):
ra, rb, rc, rd = req[i]
if a[rb - 1] - a[ra - 1] == rc:
res += rd
return res
def set_a(idx: int, au: i... | [
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change",
"literal.number.integer.change",
"io.output.change"
] | 441,070 | 441,069 | u203062059 | python |
p02695 | from itertools import combinations_with_replacement
n, m, q = map(int, input().split())
A = combinations_with_replacement(range(1, m), n)
L = []
for _ in range(q):
L.append(list(map(int, input().split())))
r = 0
for a in A:
t = 0
for l in L:
if a[l[1] - 1] - a[l[0] - 1] == l[2]:
t += l... | from itertools import combinations_with_replacement
n, m, q = map(int, input().split())
A = combinations_with_replacement(range(m), n)
L = []
for _ in range(q):
L.append(list(map(int, input().split())))
r = 0
for a in A:
t = 0
for l in L:
if a[l[1] - 1] - a[l[0] - 1] == l[2]:
t += l[3]... | [
"call.arguments.change"
] | 441,091 | 441,092 | u022871813 | python |
p02695 | from itertools import combinations_with_replacement
n, m, q = map(int, input().split())
cond = []
for _ in range(q):
a, b, c, d = map(int, input().split())
a -= 1
b -= 1
cond.append((a, b, c, d))
def calc(l):
score = 0
for a, b, c, d in cond:
if l[b] - l[a] == c:
score += ... | from itertools import combinations_with_replacement
n, m, q = map(int, input().split())
cond = []
for _ in range(q):
a, b, c, d = map(int, input().split())
a -= 1
b -= 1
cond.append((a, b, c, d))
def calc(l):
score = 0
for a, b, c, d in cond:
if l[b] - l[a] == c:
score += ... | [
"literal.number.integer.change",
"call.arguments.change"
] | 441,093 | 441,094 | u533039576 | python |
p02695 | from itertools import combinations_with_replacement
n, m, q = map(int, input().split())
cond = []
for _ in range(q):
a, b, c, d = map(int, input().split())
a -= 1
b -= 1
cond.append((a, b, c, d))
def calc(l):
score = 0
for a, b, c, d in cond:
if l[b] - l[a] == c:
score += ... | from itertools import combinations_with_replacement
n, m, q = map(int, input().split())
cond = []
for _ in range(q):
a, b, c, d = map(int, input().split())
a -= 1
b -= 1
cond.append((a, b, c, d))
def calc(l):
score = 0
for a, b, c, d in cond:
if l[b] - l[a] == c:
score += ... | [
"literal.number.integer.change",
"call.arguments.change"
] | 441,095 | 441,094 | u533039576 | python |
p02695 | # -*- coding: utf-8 -*-
import itertools
n, m, q = map(int, input().split())
a = []
b = []
c = []
d = []
for i in range(q):
_a, _b, _c, _d = map(int, input().split())
a.append(_a)
b.append(_b)
c.append(_c)
d.append(_d)
a_list = []
for i in range(10):
a_list.append(i)
suuretsu_list = itertools.combinat... | # -*- coding: utf-8 -*-
import itertools
n, m, q = map(int, input().split())
a = []
b = []
c = []
d = []
for i in range(q):
_a, _b, _c, _d = map(int, input().split())
a.append(_a)
b.append(_b)
c.append(_c)
d.append(_d)
a_list = []
for i in range(m):
a_list.append(i)
suuretsu_list = itertools.combinati... | [
"identifier.replace.add",
"literal.replace.remove",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 441,115 | 441,116 | u123849536 | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.