id stringlengths 19 19 | question_id int64 3.7k 4.03k | function_name stringlengths 6 31 | code stringlengths 91 3.68k | input stringlengths 16 99 | output stringlengths 1 63 | correct_condition stringlengths 21 153 | contest_id stringlengths 18 18 | contest_date stringdate 2025-01-05 00:00:00 2025-09-14 00:00:00 | difficulty stringclasses 3
values | metrics dict | submission_id int64 1.5B 1.77B | mutated_code stringlengths 93 3.26k | mutated_output stringlengths 1 63 | has_mutation bool 1
class | mutation_info dict |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
contest438_q3768_s1 | 3,768 | hasSameDigits | def hasSameDigits(s: str) -> bool:
while len(s)!=2:
res=""
for i in range(1,len(s)):
res+=str(int(s[i])+int(s[i-1]))[-1]
s=res
return len(set(s))==1 | hasSameDigits(s="3902") | True | hasSameDigits(s="3902") == True | weekly-contest-438 | 2025-02-23T00:00:00.000 | easy | {
"coverage": null,
"loc": 7
} | 1,552,268,304 | def hasSameDigits(s: str) -> bool:
while len(s) != 2:
res = ''
for i in range(1, len(s)):
res += str(int(s[i]) - int(s[i - 1]))[-1]
s = res
return len(set(s)) == 1 | False | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest432_q3708_s1 | 3,708 | zigzagTraversal | def zigzagTraversal(grid: List[List[int]]) -> List[int]:
m, n = len(grid), len(grid[0])
r = 1
i, j = 0, 0
res = []
while i < m:
res.append(grid[i][j])
if r:
j += 2
if j >= n:
i += 1
... | zigzagTraversal(grid=[[1,2],[3,4]]) | [1, 4] | zigzagTraversal(grid=[[1,2],[3,4]]) == [1, 4] | weekly-contest-432 | 2025-01-12T00:00:00.000 | easy | {
"coverage": null,
"loc": 23
} | 1,505,650,015 | def zigzagTraversal(grid: List[List[int]]) -> List[int]:
m, n = (len(grid), len(grid[0]))
r = 1
i, j = (1, 0)
res = []
while i < m:
res.append(grid[i][j])
if r:
j += 2
if j >= n:
i += 1
j = n - 1 - (j - n)
r = 1 ... | [3] | true | {
"coverage_similarity": 0,
"mutation_id": 2,
"mutation_type": "number"
} |
contest448_q3859_s1 | 3,859 | maxProduct | def maxProduct(n: int) -> int:
s = str(n)
arr = sorted(int(_) for _ in s)
return arr[-1] * arr[-2]
| maxProduct(n=31) | 3 | maxProduct(n=31) == 3 | weekly-contest-448 | 2025-05-04T00:00:00.000 | easy | {
"coverage": null,
"loc": 4
} | 1,624,852,966 | def maxProduct(n: int) -> int:
s = str(n)
arr = sorted((int(_) for _ in s))
return arr[-2] * arr[-2] | 1 | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "number"
} |
contest445_q3830_s0 | 3,830 | findClosest | def findClosest(x: int, y: int, z: int) -> int:
if abs(z-x) < abs(z-y):
return 1
elif abs(z-y) < abs(z-x):
return 2
return 0
| findClosest(x=2, y=7, z=4) | 1 | findClosest(x=2, y=7, z=4) == 1 | weekly-contest-445 | 2025-04-13T00:00:00.000 | easy | {
"coverage": null,
"loc": 6
} | 1,605,121,226 | def findClosest(x: int, y: int, z: int) -> int:
if abs(z + x) < abs(z - y):
return 1
elif abs(z - y) < abs(z - x):
return 2
return 0 | 0 | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest467_q3997_s2 | 3,997 | maxKDistinct | def maxKDistinct(nums: List[int], k: int) -> List[int]:
res = []
nums.sort()
while len(res) < k and nums:
x = nums.pop()
if not res or x != res[-1]:
res.append(x)
return sorted(res,reverse=True) | maxKDistinct(nums=[84,93,100,77,90], k=3) | [100, 93, 90] | maxKDistinct(nums=[84,93,100,77,90], k=3) == [100, 93, 90] | weekly-contest-467 | 2025-09-14T00:00:00.000 | easy | {
"coverage": null,
"loc": 8
} | 1,769,949,793 | def maxKDistinct(nums: List[int], k: int) -> List[int]:
res = []
nums.sort()
while len(res) <= k and nums:
x = nums.pop()
if not res or x != res[-1]:
res.append(x)
return sorted(res, reverse=True) | [100, 93, 90, 84] | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "relational"
} |
contest434_q3704_s2 | 3,704 | countPartitions | def countPartitions(nums: List[int]) -> int:
total = sum(nums)
if total % 2 != 0:
return 0
return len(nums) - 1 | countPartitions(nums=[10,10,3,7,6]) | 4 | countPartitions(nums=[10,10,3,7,6]) == 4 | weekly-contest-434 | 2025-01-26T00:00:00.000 | easy | {
"coverage": null,
"loc": 5
} | 1,520,580,436 | def countPartitions(nums: List[int]) -> int:
total = sum(nums)
if total // 2 != 0:
return 0
return len(nums) - 1 | 0 | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest455_q3914_s1 | 3,914 | checkPrimeFrequency | def checkPrimeFrequency(nums: List[int]) -> bool:
cnt = Counter(nums)
def isPrime(x):
if x < 2:
return False
for i in range(2, int(x**0.5) + 1):
if x % i == 0:
return False
return True
for v in cnt.values()... | checkPrimeFrequency(nums=[1,2,3,4,5,4]) | True | checkPrimeFrequency(nums=[1,2,3,4,5,4]) == True | weekly-contest-455 | 2025-06-22T00:00:00.000 | easy | {
"coverage": null,
"loc": 15
} | 1,672,123,316 | def checkPrimeFrequency(nums: List[int]) -> bool:
cnt = Counter(nums)
def isPrime(x):
if x <= 2:
return False
for i in range(2, int(x ** 0.5) + 1):
if x % i == 0:
return False
return True
for v in cnt.values():
if isPrime(v):
... | False | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "relational"
} |
contest433_q3731_s2 | 3,731 | subarraySum | def subarraySum(nums: List[int]) -> int:
n = len(nums)
ans = 0
for i in range(n):
start = max(0, i - nums[i])
s = 0
for j in range(start, i + 1):
s += nums[j]
ans += s
return ans | subarraySum(nums=[2,3,1]) | 11 | subarraySum(nums=[2,3,1]) == 11 | weekly-contest-433 | 2025-01-19T00:00:00.000 | easy | {
"coverage": null,
"loc": 10
} | 1,513,080,952 | def subarraySum(nums: List[int]) -> int:
n = len(nums)
ans = 0
for i in range(n):
start = max(0, i + nums[i])
s = 0
for j in range(start, i + 1):
s += nums[j]
ans += s
return ans | 0 | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest454_q3893_s0 | 3,893 | generateTag | def generateTag(s: str) -> str:
w = s.split()
if not w: return "#"
t = w[0].lower() + ''.join(x.capitalize() for x in w[1:])
t = ''.join(c for c in t if c.isalpha())
return '#' + t[:99] | generateTag(s="Leetcode daily streak achieved") | '#leetcodeDailyStreakAchieved' | generateTag(s="Leetcode daily streak achieved") == '#leetcodeDailyStreakAchieved' | weekly-contest-454 | 2025-06-15T00:00:00.000 | easy | {
"coverage": null,
"loc": 6
} | 1,664,365,781 | def generateTag(s: str) -> str:
w = s.split()
if not w:
return '#'
t = w[1].lower() + ''.join((x.capitalize() for x in w[1:]))
t = ''.join((c for c in t if c.isalpha()))
return '#' + t[:99] | '#dailyDailyStreakAchieved' | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "number"
} |
contest466_q3998_s2 | 3,998 | minOperations | def minOperations(nums: List[int]) -> int:
x = nums[0]
for v in nums[1:]:
if v != x:
return 1
return 0 | minOperations(nums=[1,2]) | 1 | minOperations(nums=[1,2]) == 1 | weekly-contest-466 | 2025-09-07T00:00:00.000 | easy | {
"coverage": null,
"loc": 6
} | 1,762,065,504 | def minOperations(nums: List[int]) -> int:
x = nums[0]
for v in nums[1:]:
if v == x:
return 1
return 0 | 0 | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "relational"
} |
contest448_q3859_s0 | 3,859 | maxProduct | def maxProduct(n: int) -> int:
l = []
while n:
l.append(n % 10)
n = n//10
l.sort()
return l[-1] * l[-2] | maxProduct(n=31) | 3 | maxProduct(n=31) == 3 | weekly-contest-448 | 2025-05-04T00:00:00.000 | easy | {
"coverage": null,
"loc": 7
} | 1,624,858,658 | def maxProduct(n: int) -> int:
l = []
while n:
l.append(n // 10)
n = n // 10
l.sort()
return l[-1] * l[-2] | 0 | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest433_q3731_s0 | 3,731 | subarraySum | def subarraySum(nums):
n=len(nums)
p=[0]*(n+1)
for i in range(n):
p[i+1]=p[i]+nums[i]
s1=0
s2=0
for i in range(n):
st=i-nums[i]
if st<0: st=0
s1+=p[i+1]
s2+=p[st]
return s1-s2 | subarraySum(nums=[2,3,1]) | 11 | subarraySum(nums=[2,3,1]) == 11 | weekly-contest-433 | 2025-01-19T00:00:00.000 | easy | {
"coverage": null,
"loc": 13
} | 1,513,087,537 | def subarraySum(nums):
n = len(nums)
p = [0] * (n + 1)
for i in range(n):
p[i - 1] = p[i] + nums[i]
s1 = 0
s2 = 0
for i in range(n):
st = i - nums[i]
if st < 0:
st = 0
s1 += p[i + 1]
s2 += p[st]
return s1 - s2 | -4 | true | {
"coverage_similarity": 0,
"mutation_id": 2,
"mutation_type": "arithmetic"
} |
contest449_q3871_s1 | 3,871 | minDeletion | def minDeletion(s: str, k: int) -> int:
arr = sorted(Counter(s).values())
n = len(arr)
return sum(arr[:n - k]) if n > k else 0 | minDeletion(s="abc", k=2) | 1 | minDeletion(s="abc", k=2) == 1 | weekly-contest-449 | 2025-05-11T00:00:00.000 | easy | {
"coverage": null,
"loc": 4
} | 1,630,586,515 | def minDeletion(s: str, k: int) -> int:
arr = sorted(Counter(s).values())
n = len(arr)
return sum(arr[:n + k]) if n > k else 0 | 3 | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest443_q3832_s0 | 3,832 | minCosts | def minCosts(a: List[int]) -> List[int]:
res = a
for i in range(1, len(res)):
res[i] = min(res[i], res[i - 1])
return res | minCosts(a=[5,3,4,1,3,2]) | [5, 3, 3, 1, 1, 1] | minCosts(a=[5,3,4,1,3,2]) == [5, 3, 3, 1, 1, 1] | weekly-contest-443 | 2025-03-30T00:00:00.000 | easy | {
"coverage": null,
"loc": 5
} | 1,590,604,607 | def minCosts(a: List[int]) -> List[int]:
res = a
for i in range(1, len(res)):
res[i] = min(res[i], res[i - 0])
return res | [5, 3, 4, 1, 3, 2] | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "number"
} |
contest432_q3708_s0 | 3,708 | zigzagTraversal | def zigzagTraversal(grid: List[List[int]]) -> List[int]:
R, C = len(grid), len(grid[0])
ans = []
i, j = 0, 0
def connected(i, j, ii, jj):
return (i == ii and abs(j - jj) == 1) or (j == jj and abs(i - ii) == 1)
dir = 1
while 0 <= i < R and 0 <= j < C:
... | zigzagTraversal(grid=[[1,2],[3,4]]) | [1, 4] | zigzagTraversal(grid=[[1,2],[3,4]]) == [1, 4] | weekly-contest-432 | 2025-01-12T00:00:00.000 | easy | {
"coverage": null,
"loc": 28
} | 1,505,653,842 | def zigzagTraversal(grid: List[List[int]]) -> List[int]:
R, C = (len(grid), len(grid[0]))
ans = []
i, j = (0, 0)
def connected(i, j, ii, jj):
return i == ii and abs(j - jj) == 1 or (j == jj and abs(i - ii) == 1)
dir = 1
while 0 <= i < R and 0 <= j < C:
ans.append(grid[i][j])
... | [1] | true | {
"coverage_similarity": 0,
"mutation_id": 2,
"mutation_type": "arithmetic"
} |
contest431_q3702_s1 | 3,702 | maxLength | def maxLength(nums: List[int]) -> int:
ans = 1
run = 1
for l in range(len(nums)):
for r in range(l, len(nums)):
a = nums[l:r+1]
prod = 1
g = nums[l]
lc = nums[l]
for v in a:
g = gcd(g,... | maxLength(nums=[1,2,1,2,1,1,1]) | 5 | maxLength(nums=[1,2,1,2,1,1,1]) == 5 | weekly-contest-431 | 2025-01-05T00:00:00.000 | easy | {
"coverage": null,
"loc": 16
} | 1,497,983,616 | def maxLength(nums: List[int]) -> int:
ans = 1
run = 1
for l in range(len(nums)):
for r in range(l, len(nums)):
a = nums[l:r + 1]
prod = 1
g = nums[l]
lc = nums[l]
for v in a:
g = gcd(g, v)
lc = lcm(lc, v)
... | 3 | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "arithmetic"
} |
contest462_q3973_s1 | 3,973 | reverseSubmatrix | def reverseSubmatrix(grid: List[List[int]], x: int, y: int, k: int) -> List[List[int]]:
for i in range(k//2):
for j in range(y,y+k):
grid[x+i][j],grid[x+k-1-i][j] = grid[x+k-1-i][j],grid[x+i][j]
return grid | reverseSubmatrix(grid=[[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]], x=1, y=0, k=3) | [[1, 2, 3, 4], [13, 14, 15, 8], [9, 10, 11, 12], [5, 6, 7, 16]] | reverseSubmatrix(grid=[[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]], x=1, y=0, k=3) == [[1, 2, 3, 4], [13, 14, 15, 8], [9, 10, 11, 12], [5, 6, 7, 16]] | weekly-contest-462 | 2025-08-10T00:00:00.000 | easy | {
"coverage": null,
"loc": 5
} | 1,729,527,513 | def reverseSubmatrix(grid: List[List[int]], x: int, y: int, k: int) -> List[List[int]]:
for i in range(k // 2):
for j in range(y, y - k):
grid[x + i][j], grid[x + k - 1 - i][j] = (grid[x + k - 1 - i][j], grid[x + i][j])
return grid | [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]] | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "arithmetic"
} |
contest438_q3768_s0 | 3,768 | hasSameDigits | def hasSameDigits(s: str) -> bool:
n = len(s)
if n == 2:
return (s[0] == s[1])
digits = list(map(int, s))
N = n - 2
binom_mod5 = [[0]*5 for _ in range(5)]
for i in range(5):
binom_mod5[i][0] = 1
for j in range(1, i+1):
... | hasSameDigits(s="3902") | True | hasSameDigits(s="3902") == True | weekly-contest-438 | 2025-02-23T00:00:00.000 | easy | {
"coverage": null,
"loc": 50
} | 1,552,284,205 | def hasSameDigits(s: str) -> bool:
n = len(s)
if n == 2:
return s[0] == s[1]
digits = list(map(int, s))
N = n - 2
binom_mod5 = [[0] * 5 for _ in range(5)]
for i in range(5):
binom_mod5[i][0] = 1
for j in range(1, i - 1):
from math import comb
binom... | False | true | {
"coverage_similarity": 0,
"mutation_id": 2,
"mutation_type": "arithmetic"
} |
contest467_q4012_s1 | 4,012 | earliestTime | def earliestTime(tasks: List[List[int]]) -> int:
return min(t[0] + t[1] for t in tasks) | earliestTime(tasks=[[1,6],[2,3]]) | 5 | earliestTime(tasks=[[1,6],[2,3]]) == 5 | weekly-contest-467 | 2025-09-14T00:00:00.000 | easy | {
"coverage": null,
"loc": 2
} | 1,769,946,189 | def earliestTime(tasks: List[List[int]]) -> int:
return min((t[0] - t[1] for t in tasks)) | -5 | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest445_q3830_s1 | 3,830 | findClosest | def findClosest(x: int, y: int, z: int) -> int:
if abs(z - y) == abs(z - x):
return 0
elif abs(z - y) < abs(z - x):
return 2
else:
return 1 | findClosest(x=2, y=7, z=4) | 1 | findClosest(x=2, y=7, z=4) == 1 | weekly-contest-445 | 2025-04-13T00:00:00.000 | easy | {
"coverage": null,
"loc": 7
} | 1,605,117,709 | def findClosest(x: int, y: int, z: int) -> int:
if abs(z - y) == abs(z - x):
return 0
elif abs(z - y) < abs(z + x):
return 2
else:
return 1 | 2 | true | {
"coverage_similarity": 0,
"mutation_id": 3,
"mutation_type": "arithmetic"
} |
contest449_q3871_s2 | 3,871 | minDeletion | def minDeletion(s: str, k: int) -> int:
freq = {}
for ch in s:
freq[ch] = freq.get(ch, 0) + 1
if len(freq) <= k:
return 0
sorted_freqs = sorted(freq.values(), reverse=True)
keep_count = sum(sorted_freqs[:k])
return len(s) - keep_count | minDeletion(s="abc", k=2) | 1 | minDeletion(s="abc", k=2) == 1 | weekly-contest-449 | 2025-05-11T00:00:00.000 | easy | {
"coverage": null,
"loc": 11
} | 1,630,586,123 | def minDeletion(s: str, k: int) -> int:
freq = {}
for ch in s:
freq[ch] = freq.get(ch, 0) - 1
if len(freq) <= k:
return 0
sorted_freqs = sorted(freq.values(), reverse=True)
keep_count = sum(sorted_freqs[:k])
return len(s) - keep_count | 5 | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest461_q3952_s0 | 3,952 | isTrionic | def isTrionic(a: list[int]) -> bool:
n = len(a)
if n < 3:
return False
p = 0
f1 = f2 = f3 = False
for i in range(1, n):
u, v = a[i - 1], a[i]
if v == u:
return False
if p == 0:
if v > u:
... | isTrionic(a=[1,3,5,4,2,6]) | True | isTrionic(a=[1,3,5,4,2,6]) == True | weekly-contest-461 | 2025-08-03T00:00:00.000 | easy | {
"coverage": null,
"loc": 32
} | 1,721,337,202 | def isTrionic(a: list[int]) -> bool:
n = len(a)
if n < 3:
return False
p = 0
f1 = f2 = f3 = False
for i in range(1, n):
u, v = (a[i + 1], a[i])
if v == u:
return False
if p == 0:
if v > u:
f1 = True
else:
... | False | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest467_q3997_s0 | 3,997 | maxKDistinct | def maxKDistinct(nums: List[int], k: int) -> List[int]:
res = []
nums.sort(reverse=True)
seen = set()
taken = 0
for i, v in enumerate(nums):
if taken == k:
break
if v in seen:
continue
seen.add(v)
res... | maxKDistinct(nums=[84,93,100,77,90], k=3) | [100, 93, 90] | maxKDistinct(nums=[84,93,100,77,90], k=3) == [100, 93, 90] | weekly-contest-467 | 2025-09-14T00:00:00.000 | easy | {
"coverage": null,
"loc": 16
} | 1,769,946,197 | def maxKDistinct(nums: List[int], k: int) -> List[int]:
res = []
nums.sort(reverse=True)
seen = set()
taken = 0
for i, v in enumerate(nums):
if taken != k:
break
if v in seen:
continue
seen.add(v)
res.append(v)
taken += 1
return res | [] | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "relational"
} |
contest437_q3709_s2 | 3,709 | hasSpecialSubstring | def hasSpecialSubstring(s: str, k: int) -> bool:
n = len(s)
for i in range(n - k + 1):
c = s[i]
if all(s[i + j] == c for j in range(k)):
if (i == 0 or s[i - 1] != c) and (i + k == n or s[i + k] != c):
return True
return False | hasSpecialSubstring(s="aaabaaa", k=3) | True | hasSpecialSubstring(s="aaabaaa", k=3) == True | weekly-contest-437 | 2025-02-16T00:00:00.000 | easy | {
"coverage": null,
"loc": 8
} | 1,544,547,904 | def hasSpecialSubstring(s: str, k: int) -> bool:
n = len(s)
for i in range(n - k + 1):
c = s[i]
if all((s[i + j] != c for j in range(k))):
if (i == 0 or s[i - 1] != c) and (i + k == n or s[i + k] != c):
return True
return False | False | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "relational"
} |
contest451_q3879_s0 | 3,879 | minCuttingCost | def minCuttingCost(n: int, m: int, k: int) -> int:
return (n - k) * k * (n > k) + (m - k) * k * (m > k)
| minCuttingCost(n=6, m=5, k=5) | 5 | minCuttingCost(n=6, m=5, k=5) == 5 | weekly-contest-451 | 2025-05-25T00:00:00.000 | easy | {
"coverage": null,
"loc": 2
} | 1,643,574,218 | def minCuttingCost(n: int, m: int, k: int) -> int:
return (n - k) // k * (n > k) + (m - k) * k * (m > k) | 0 | true | {
"coverage_similarity": 0,
"mutation_id": 2,
"mutation_type": "arithmetic"
} |
contest462_q3973_s2 | 3,973 | reverseSubmatrix | def reverseSubmatrix(grid: List[List[int]], x: int, y: int, k: int) -> List[List[int]]:
for i in range(k // 2):
m = x + i
n = x + k - 1 - i
grid[m][y:y + k], grid[n][y:y + k] = grid[n][y:y + k], grid[m][y:y + k]
return grid | reverseSubmatrix(grid=[[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]], x=1, y=0, k=3) | [[1, 2, 3, 4], [13, 14, 15, 8], [9, 10, 11, 12], [5, 6, 7, 16]] | reverseSubmatrix(grid=[[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]], x=1, y=0, k=3) == [[1, 2, 3, 4], [13, 14, 15, 8], [9, 10, 11, 12], [5, 6, 7, 16]] | weekly-contest-462 | 2025-08-10T00:00:00.000 | easy | {
"coverage": null,
"loc": 6
} | 1,729,527,363 | def reverseSubmatrix(grid: List[List[int]], x: int, y: int, k: int) -> List[List[int]]:
for i in range(k // 2):
m = x + i
n = x - k - 1 - i
grid[m][y:y + k], grid[n][y:y + k] = (grid[n][y:y + k], grid[m][y:y + k])
return grid | [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]] | true | {
"coverage_similarity": 0,
"mutation_id": 4,
"mutation_type": "arithmetic"
} |
contest442_q3817_s2 | 3,817 | maxContainers | def maxContainers(n: int, w: int, maxWeight: int) -> int:
return min(maxWeight // w, n * n) | maxContainers(n=2, w=3, maxWeight=15) | 4 | maxContainers(n=2, w=3, maxWeight=15) == 4 | weekly-contest-442 | 2025-03-23T00:00:00.000 | easy | {
"coverage": null,
"loc": 2
} | 1,582,820,286 | def maxContainers(n: int, w: int, maxWeight: int) -> int:
return min(maxWeight // w, n // n) | 1 | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "arithmetic"
} |
contest455_q3914_s2 | 3,914 | checkPrimeFrequency | def checkPrimeFrequency(nums: List[int]) -> bool:
# frequency map
freq = Counter(nums)
# find if n is prime
def is_prime(n: int) -> bool:
if n <= 1:
return False
if n <= 3:
return True
if n % 2 == 0:
ret... | checkPrimeFrequency(nums=[1,2,3,4,5,4]) | True | checkPrimeFrequency(nums=[1,2,3,4,5,4]) == True | weekly-contest-455 | 2025-06-22T00:00:00.000 | easy | {
"coverage": null,
"loc": 22
} | 1,672,125,677 | def checkPrimeFrequency(nums: List[int]) -> bool:
freq = Counter(nums)
def is_prime(n: int) -> bool:
if n <= 1:
return False
if n <= 3:
return False
if n % 2 == 0:
return False
limit = isqrt(n)
for d in range(3, limit + 1, 2):
... | False | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "keyword"
} |
contest443_q3832_s1 | 3,832 | minCosts | def minCosts(cost: List[int]) -> List[int]:
for i in range(1, len(cost)):
if cost[i] > cost[i-1]:
cost[i] = cost[i-1]
return cost | minCosts(cost=[5,3,4,1,3,2]) | [5, 3, 3, 1, 1, 1] | minCosts(cost=[5,3,4,1,3,2]) == [5, 3, 3, 1, 1, 1] | weekly-contest-443 | 2025-03-30T00:00:00.000 | easy | {
"coverage": null,
"loc": 5
} | 1,590,616,291 | def minCosts(cost: List[int]) -> List[int]:
for i in range(1, len(cost)):
if cost[i] > cost[i - 1]:
cost[i] = cost[i + 1]
return cost | [5, 3, 1, 1, 2, 2] | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "arithmetic"
} |
contest462_q3973_s0 | 3,973 | reverseSubmatrix | def reverseSubmatrix(g: List[List[int]], a: int, b: int, s: int) -> List[List[int]]:
r, c, k = a, b, s
tmp = [g[r + i][c:c + k] for i in range(k)]
for i, v in enumerate(reversed(tmp)):
g[r + i][c:c + k] = v
return g
| reverseSubmatrix(g=[[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]], a=1, b=0, s=3) | [[1, 2, 3, 4], [13, 14, 15, 8], [9, 10, 11, 12], [5, 6, 7, 16]] | reverseSubmatrix(g=[[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]], a=1, b=0, s=3) == [[1, 2, 3, 4], [13, 14, 15, 8], [9, 10, 11, 12], [5, 6, 7, 16]] | weekly-contest-462 | 2025-08-10T00:00:00.000 | easy | {
"coverage": null,
"loc": 6
} | 1,729,547,666 | def reverseSubmatrix(g: List[List[int]], a: int, b: int, s: int) -> List[List[int]]:
r, c, k = (a, b, s)
tmp = [g[r - i][c:c + k] for i in range(k)]
for i, v in enumerate(reversed(tmp)):
g[r + i][c:c + k] = v
return g | [[1, 2, 3, 4], [13, 14, 15, 8], [1, 2, 3, 12], [5, 6, 7, 16]] | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest439_q3705_s2 | 3,705 | largestInteger | def largestInteger(nums: List[int], k: int) -> int:
freq = defaultdict(int)
n = len(nums)
for i in range(n - k + 1):
subarray = nums[i:i + k]
unique_elements = set(subarray)
for num in unique_elements:
freq[num] += 1
result = -1
... | largestInteger(nums=[3,9,2,1,7], k=3) | 7 | largestInteger(nums=[3,9,2,1,7], k=3) == 7 | weekly-contest-439 | 2025-03-02T00:00:00.000 | easy | {
"coverage": null,
"loc": 16
} | 1,559,813,970 | def largestInteger(nums: List[int], k: int) -> int:
freq = defaultdict(int)
n = len(nums)
for i in range(n - k - 1):
subarray = nums[i:i + k]
unique_elements = set(subarray)
for num in unique_elements:
freq[num] += 1
result = -1
for num, count in freq.items():
... | 9 | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest431_q3702_s0 | 3,702 | maxLength | def maxLength(nums: List[int]) -> int:
n = len(nums)
ans = 0
for l in range(n):
a = 1
b = 1
c = 0
for r in range(l, n):
a *= nums[r]
b = lcm(b, nums[r])
c = gcd(c, nums[r])
if a == b *... | maxLength(nums=[1,2,1,2,1,1,1]) | 5 | maxLength(nums=[1,2,1,2,1,1,1]) == 5 | weekly-contest-431 | 2025-01-05T00:00:00.000 | easy | {
"coverage": null,
"loc": 16
} | 1,497,983,046 | def maxLength(nums: List[int]) -> int:
n = len(nums)
ans = 0
for l in range(n):
a = 1
b = 1
c = 0
for r in range(l, n):
a *= nums[r]
b = lcm(b, nums[r])
c = gcd(c, nums[r])
if a == b * c:
ans = max(ans, r - l - 1... | 3 | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "arithmetic"
} |
contest435_q3753_s1 | 3,753 | maxDifference | def maxDifference(s: str) -> int:
count = [0] * 26
for c in s:
count[ord(c) - ord('a')] += 1
odd = -1
even = float('inf')
for x in count:
if x:
if x % 2 == 0:
even = min(even, x)
else:
... | maxDifference(s="aaaaabbc") | 3 | maxDifference(s="aaaaabbc") == 3 | weekly-contest-435 | 2025-02-02T00:00:00.000 | easy | {
"coverage": null,
"loc": 14
} | 1,528,102,981 | def maxDifference(s: str) -> int:
count = [0] * 26
for c in s:
count[ord(c) - ord('a')] += 1
odd = -1
even = float('inf')
for x in count:
if x:
if x // 2 == 0:
even = min(even, x)
else:
odd = max(odd, x)
return odd - even | 4 | true | {
"coverage_similarity": 0,
"mutation_id": 2,
"mutation_type": "arithmetic"
} |
contest461_q3952_s2 | 3,952 | isTrionic | def isTrionic(nums: List[int]) -> bool:
prev = -1
for i in range(1, len(nums)):
a = nums[i-1]
b = nums[i]
if a == b:
return False
if a > b:
if i == 1:
return False
if prev != -1 and prev !... | isTrionic(nums=[1,3,5,4,2,6]) | True | isTrionic(nums=[1,3,5,4,2,6]) == True | weekly-contest-461 | 2025-08-03T00:00:00.000 | easy | {
"coverage": null,
"loc": 14
} | 1,721,315,243 | def isTrionic(nums: List[int]) -> bool:
prev = -1
for i in range(1, len(nums)):
a = nums[i + 1]
b = nums[i]
if a == b:
return False
if a > b:
if i == 1:
return False
if prev != -1 and prev != i - 1:
return False
... | False | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest441_q3788_s0 | 3,788 | maxSum | def maxSum(a: List[int]) -> int:
s = {x for x in a if x > 0}
return sum(s) if s else max(a)
| maxSum(a=[1,2,3,4,5]) | 15 | maxSum(a=[1,2,3,4,5]) == 15 | weekly-contest-441 | 2025-03-16T00:00:00.000 | easy | {
"coverage": null,
"loc": 3
} | 1,575,094,028 | def maxSum(a: List[int]) -> int:
s = {x for x in a if x > 1}
return sum(s) if s else max(a) | 14 | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "number"
} |
contest447_q3819_s2 | 3,819 | countCoveredBuildings | def countCoveredBuildings(n: int, buildings: List[List[int]]) -> int:
rows = {}
cols = {}
for x, y in buildings:
rows.setdefault(x, []).append(y)
cols.setdefault(y, []).append(x)
for r in rows:
rows[r].sort()
for c in cols:
cols[c].... | countCoveredBuildings(n=3, buildings=[[1,2],[2,2],[3,2],[2,1],[2,3]]) | 1 | countCoveredBuildings(n=3, buildings=[[1,2],[2,2],[3,2],[2,1],[2,3]]) == 1 | weekly-contest-447 | 2025-04-27T00:00:00.000 | medium | {
"coverage": null,
"loc": 27
} | 1,618,870,819 | def countCoveredBuildings(n: int, buildings: List[List[int]]) -> int:
rows = {}
cols = {}
for x, y in buildings:
rows.setdefault(x, []).append(y)
cols.setdefault(y, []).append(x)
for r in rows:
rows[r].sort()
for c in cols:
cols[c].sort()
covered = 0
for x, y ... | 5 | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "logical"
} |
contest440_q3759_s2 | 3,759 | findMaxSum | def findMaxSum(a: List[int], b: List[int], k: int) -> List[int]:
n = len(a)
P = sorted(zip(a, b, range(n)), key=lambda x: x[0])
R = [0] * n
h, s = [], 0
i = 0
while i < n:
j = i
while j < n and P[j][0] == P[i][0]:
R[P[j][2]] = s
... | findMaxSum(a=[4,2,1,5,3], b=[10,20,30,40,50], k=2) | [80, 30, 0, 80, 50] | findMaxSum(a=[4,2,1,5,3], b=[10,20,30,40,50], k=2) == [80, 30, 0, 80, 50] | weekly-contest-440 | 2025-03-09T00:00:00.000 | medium | {
"coverage": null,
"loc": 20
} | 1,567,577,211 | def findMaxSum(a: List[int], b: List[int], k: int) -> List[int]:
n = len(a)
P = sorted(zip(a, b, range(n)), key=lambda x: x[0])
R = [0] * n
h, s = ([], 0)
i = 0
while i < n:
j = i
while j < n and P[j][0] == P[i][0]:
R[P[j][2]] = s
j += 1
for _, y, ... | [120, 30, 0, 120, 50] | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "arithmetic"
} |
contest443_q3793_s0 | 3,793 | longestPalindrome | def longestPalindrome(s: str, t: str) -> int:
n, m = len(s), len(t)
palS = [[False] * n for _ in range(n)]
for i in range(n):
palS[i][i] = True
for i in range(n - 1):
palS[i][i + 1] = (s[i] == s[i + 1])
for length in range(3, n + 1):
for i in r... | longestPalindrome(s="a", t="a") | 2 | longestPalindrome(s="a", t="a") == 2 | weekly-contest-443 | 2025-03-30T00:00:00.000 | medium | {
"coverage": null,
"loc": 62
} | 1,590,627,738 | def longestPalindrome(s: str, t: str) -> int:
n, m = (len(s), len(t))
palS = [[False] * n for _ in range(n)]
for i in range(n):
palS[i][i] = True
for i in range(n - 1):
palS[i][i + 1] = s[i] == s[i + 1]
for length in range(3, n + 1):
for i in range(n - length + 1):
... | 1 | true | {
"coverage_similarity": 0,
"mutation_id": 32,
"mutation_type": "arithmetic"
} |
contest452_q3884_s1 | 3,884 | minAbsDiff | def minAbsDiff(grid: List[List[int]], k: int) -> List[List[int]]:
m = len(grid)
n = len(grid[0])
rows = m - k + 1
cols = n - k + 1
result = [[0 for _ in range(cols)] for _ in range(rows)]
for i in range(rows):
for j in range(cols):
values = []
... | minAbsDiff(grid=[[1,8],[3,-2]], k=2) | [[2]] | minAbsDiff(grid=[[1,8],[3,-2]], k=2) == [[2]] | weekly-contest-452 | 2025-06-01T00:00:00.000 | medium | {
"coverage": null,
"loc": 23
} | 1,650,226,503 | def minAbsDiff(grid: List[List[int]], k: int) -> List[List[int]]:
m = len(grid)
n = len(grid[0])
rows = m - k - 1
cols = n - k + 1
result = [[0 for _ in range(cols)] for _ in range(rows)]
for i in range(rows):
for j in range(cols):
values = []
for x in range(i, i ... | [] | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest437_q3779_s0 | 3,779 | maxWeight | def maxWeight(p: List[int]) -> int:
p.sort(reverse=True)
m = len(p) // 4
m1 = (m + 1) // 2
m2 = m - m1
s = sum(p[:m1])
for i in range(m2):
s += p[m1 + 2 * i + 1]
return s | maxWeight(p=[1,2,3,4,5,6,7,8]) | 14 | maxWeight(p=[1,2,3,4,5,6,7,8]) == 14 | weekly-contest-437 | 2025-02-16T00:00:00.000 | medium | {
"coverage": null,
"loc": 9
} | 1,544,509,185 | def maxWeight(p: List[int]) -> int:
p.sort(reverse=True)
m = len(p) // 4
m1 = (m + 1) * 2
m2 = m - m1
s = sum(p[:m1])
for i in range(m2):
s += p[m1 + 2 * i + 1]
return s | 33 | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "arithmetic"
} |
contest436_q3760_s0 | 3,760 | assignElements | def assignElements(groups: List[int], elements: List[int]) -> List[int]:
s = set()
dic = defaultdict(int)
for i, e in enumerate(elements):
if e in s:
continue
t = 1
while e * t <= 100000:
if e * t not in dic:
... | assignElements(groups=[8,4,3,2,4], elements=[4,2]) | [0, 0, -1, 1, 0] | assignElements(groups=[8,4,3,2,4], elements=[4,2]) == [0, 0, -1, 1, 0] | weekly-contest-436 | 2025-02-09T00:00:00.000 | medium | {
"coverage": null,
"loc": 23
} | 1,536,410,003 | def assignElements(groups: List[int], elements: List[int]) -> List[int]:
s = set()
dic = defaultdict(int)
for i, e in enumerate(elements):
if e in s:
continue
t = 1
while e * t <= 100000:
if e // t not in dic:
dic[e * t] = i
t += 1
... | [1, 1, -1, 1, 1] | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "arithmetic"
} |
contest454_q3885_s0 | 3,885 | specialTriplets | def specialTriplets(a: list[int]) -> int:
m = 10**9+7; n = len(a); l, r = Counter(), Counter(a); s = 0
for i in range(n):
r[a[i]] -= 1; d = a[i] * 2
s += l[d] * r[d]; s %= m
l[a[i]] += 1
return s
| specialTriplets(a=[6,3,6]) | 1 | specialTriplets(a=[6,3,6]) == 1 | weekly-contest-454 | 2025-06-15T00:00:00.000 | medium | {
"coverage": null,
"loc": 7
} | 1,664,369,401 | def specialTriplets(a: list[int]) -> int:
m = 10 ** 9 + 7
n = len(a)
l, r = (Counter(), Counter(a))
s = 0
for i in range(n):
r[a[i]] -= 1
d = a[i] // 2
s += l[d] * r[d]
s %= m
l[a[i]] += 1
return s | 0 | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "arithmetic"
} |
contest436_q3760_s1 | 3,760 | assignElements | def assignElements(groups: List[int], elements: List[int]) -> List[int]:
res = [-1]*len(groups)
max_value = max(groups)
mapper = collections.defaultdict(list)
for i,x in enumerate(groups):
mapper[x].append(i)
seen = set()
... | assignElements(groups=[8,4,3,2,4], elements=[4,2]) | [0, 0, -1, 1, 0] | assignElements(groups=[8,4,3,2,4], elements=[4,2]) == [0, 0, -1, 1, 0] | weekly-contest-436 | 2025-02-09T00:00:00.000 | medium | {
"coverage": null,
"loc": 24
} | 1,536,400,600 | def assignElements(groups: List[int], elements: List[int]) -> List[int]:
res = [-1] * len(groups)
max_value = max(groups)
mapper = collections.defaultdict(list)
for i, x in enumerate(groups):
mapper[x].append(i)
seen = set()
for j in range(len(elements)):
if elements[j] in seen:
... | [-1, 0, -1, 1, 0] | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "relational"
} |
contest453_q3876_s1 | 3,876 | canMakeEqual | def canMakeEqual(nums: List[int], k: int) -> bool:
def can_t(target:int) -> bool:
arr= nums[:]
ops=0
for i in range(len(arr)-1):
if arr[i]!=target:
arr[i]*=-1
arr[i+1]*=-1
ops+=1
return ar... | canMakeEqual(nums=[1,-1,1,-1,1], k=3) | True | canMakeEqual(nums=[1,-1,1,-1,1], k=3) == True | weekly-contest-453 | 2025-06-08T00:00:00.000 | medium | {
"coverage": null,
"loc": 11
} | 1,657,169,141 | def canMakeEqual(nums: List[int], k: int) -> bool:
def can_t(target: int) -> bool:
arr = nums[:]
ops = 0
for i in range(len(arr) - 1):
if arr[i] != target:
arr[i] *= -1
arr[i + 1] *= -1
ops += 1
return arr[-1] == target and... | False | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "logical"
} |
contest452_q3870_s1 | 3,870 | minMoves | def minMoves(classroom: List[str], energy: int) -> int:
m = len(classroom)
n = len(classroom[0])
startI = startJ = 0
litterMap = {}
idx = 0
for i in range(m):
for j in range(n):
c = classroom[i][j]
if c == 'S':
... | minMoves(classroom=["S.", "XL"], energy=2) | 2 | minMoves(classroom=["S.", "XL"], energy=2) == 2 | weekly-contest-452 | 2025-06-01T00:00:00.000 | medium | {
"coverage": null,
"loc": 44
} | 1,650,270,272 | def minMoves(classroom: List[str], energy: int) -> int:
m = len(classroom)
n = len(classroom[0])
startI = startJ = 0
litterMap = {}
idx = 0
for i in range(m):
for j in range(n):
c = classroom[i][j]
if c == 'S':
startI, startJ = (i, j)
e... | -1 | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest463_q3974_s2 | 3,974 | xorAfterQueries | def xorAfterQueries(nums: List[int], queries: List[List[int]]) -> int:
mod = 10**9 + 7
for l, r, k, v in queries:
for i in range(l,r + 1, k):
nums[i] = (nums[i] * v) % mod
ans = 0
for x in nums:
ans ^= x
return ans
| xorAfterQueries(nums=[1,1,1], queries=[[0,2,1,4]]) | 4 | xorAfterQueries(nums=[1,1,1], queries=[[0,2,1,4]]) == 4 | weekly-contest-463 | 2025-08-17T00:00:00.000 | medium | {
"coverage": null,
"loc": 10
} | 1,737,955,530 | def xorAfterQueries(nums: List[int], queries: List[List[int]]) -> int:
mod = 10 ** 9 + 7
for l, r, k, v in queries:
for i in range(l, r + 1, k):
nums[i] = nums[i] * v // mod
ans = 0
for x in nums:
ans ^= x
return ans | 0 | true | {
"coverage_similarity": 0,
"mutation_id": 2,
"mutation_type": "arithmetic"
} |
contest446_q3831_s0 | 3,831 | resultArray | def resultArray(nums: List[int], k: int) -> List[int]:
res = [0] * k
prev = [0] * k
for n in nums:
m = n % k
cur = [0] * k
cur[m] += 1
for r in range(k):
if prev[r]:
new_r = (r * m) % k
cur[n... | resultArray(nums=[1,2,3,4,5], k=3) | [9, 2, 4] | resultArray(nums=[1,2,3,4,5], k=3) == [9, 2, 4] | weekly-contest-446 | 2025-04-20T00:00:00.000 | medium | {
"coverage": null,
"loc": 17
} | 1,612,012,857 | def resultArray(nums: List[int], k: int) -> List[int]:
res = [0] * k
prev = [0] * k
for n in nums:
m = n // k
cur = [0] * k
cur[m] += 1
for r in range(k):
if prev[r]:
new_r = r * m % k
cur[new_r] += prev[r]
for r in range(k)... | [9, 6, 0] | true | {
"coverage_similarity": 0,
"mutation_id": 2,
"mutation_type": "arithmetic"
} |
contest433_q3714_s2 | 3,714 | minMaxSums | def minMaxSums(nums: List[int], k: int) -> int:
MOD = 10**9+7
n = len(nums)
nums.sort()
fact = [1] * (n+1)
inv_fact = [1] * (n+1)
for i in range(1,n+1):
fact[i] = fact[i-1] * i % MOD
inv_fact[n] = pow(fact[n], MOD-2, MOD)
for ... | minMaxSums(nums=[1,2,3], k=2) | 24 | minMaxSums(nums=[1,2,3], k=2) == 24 | weekly-contest-433 | 2025-01-19T00:00:00.000 | medium | {
"coverage": null,
"loc": 30
} | 1,513,086,962 | def minMaxSums(nums: List[int], k: int) -> int:
MOD = 10 ** 9 - 7
n = len(nums)
nums.sort()
fact = [1] * (n + 1)
inv_fact = [1] * (n + 1)
for i in range(1, n + 1):
fact[i] = fact[i - 1] * i % MOD
inv_fact[n] = pow(fact[n], MOD - 2, MOD)
for i in range(n - 1, -1, -1):
inv_... | 880765893 | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest457_q3863_s0 | 3,863 | processQueries | def processQueries(c: int, connections: List[List[int]], queries: List[List[int]]) -> List[int]:
rank = [0] * (c + 1)
parent = list(range(c + 1))
def find(x):
while parent[x] != x:
parent[x] = parent[parent[x]]
x = parent[x]
return x
... | processQueries(c=5, connections=[[1,2],[2,3],[3,4],[4,5]], queries=[[1,3],[2,1],[1,1],[2,2],[1,2]]) | [3, 2, 3] | processQueries(c=5, connections=[[1,2],[2,3],[3,4],[4,5]], queries=[[1,3],[2,1],[1,1],[2,2],[1,2]]) == [3, 2, 3] | weekly-contest-457 | 2025-07-06T00:00:00.000 | medium | {
"coverage": null,
"loc": 48
} | 1,687,854,117 | def processQueries(c: int, connections: List[List[int]], queries: List[List[int]]) -> List[int]:
rank = [0] * (c + 1)
parent = list(range(c + 1))
def find(x):
while parent[x] != x:
parent[x] = parent[parent[x]]
x = parent[x]
return x
def union(a, b):
a, ... | [3, -1, -1] | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "relational"
} |
contest460_q3933_s2 | 3,933 | minJumps | def minJumps(a: List[int]) -> int:
n=len(a)
if n<2: return 0
M=max(a)
spf=list(range(M+1))
for i in range(2,int(M**0.5)+1):
if spf[i]==i:
for j in range(i*i,M+1,i):
if spf[j]==j: spf[j]=i
mp={}
for i,v in enumerate(a... | minJumps(a=[1,2,4,6]) | 2 | minJumps(a=[1,2,4,6]) == 2 | weekly-contest-460 | 2025-07-27T00:00:00.000 | medium | {
"coverage": null,
"loc": 33
} | 1,712,748,830 | def minJumps(a: List[int]) -> int:
n = len(a)
if n < 2:
return 0
M = max(a)
spf = list(range(M + 1))
for i in range(2, int(M ** 0.5) - 1):
if spf[i] == i:
for j in range(i * i, M + 1, i):
if spf[j] == j:
spf[j] = i
mp = {}
for i... | 3 | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "arithmetic"
} |
contest438_q3764_s1 | 3,764 | maxSum | def maxSum(grid: List[List[int]], limits: List[int], k: int) -> int:
a = [(sorted(x,reverse=True)[:limits[i]]) for i,x in enumerate(grid)]
b=[]
for x in a:b.extend(x)
a=b.copy()
# print(a)
return sum(sorted(a,reverse=True)[:k]) | maxSum(grid=[[1,2],[3,4]], limits=[1,2], k=2) | 7 | maxSum(grid=[[1,2],[3,4]], limits=[1,2], k=2) == 7 | weekly-contest-438 | 2025-02-23T00:00:00.000 | medium | {
"coverage": null,
"loc": 7
} | 1,552,272,249 | def maxSum(grid: List[List[int]], limits: List[int], k: int) -> int:
a = [sorted(x, reverse=True)[:limits[i]] for i, x in enumerate(grid)]
b = []
for x in a:
b.extend(x)
a = b.copy()
return sum(sorted(a, reverse=False)[:k]) | 5 | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "keyword"
} |
contest453_q3835_s1 | 3,835 | countPartitions | def countPartitions(nums: List[int], k: int) -> int:
MOD = 10**9 + 7
n = len(nums)
# prefix[i] = dp[0] + dp[1] + ... + dp[i]
# where dp[0]=1 (empty prefix) and dp[i] = #ways to partition nums[:i]
prefix = [0] * (n+1)
prefix[0] = 1
maxD = deque() ... | countPartitions(nums=[9,4,1,3,7], k=4) | 6 | countPartitions(nums=[9,4,1,3,7], k=4) == 6 | weekly-contest-453 | 2025-06-08T00:00:00.000 | medium | {
"coverage": null,
"loc": 50
} | 1,657,193,577 | def countPartitions(nums: List[int], k: int) -> int:
MOD = 10 ** 9 + 7
n = len(nums)
prefix = [0] * (n + 1)
prefix[0] = 1
maxD = deque()
minD = deque()
low = 1
dp_n = 0
for i in range(1, n - 1):
x = nums[i - 1]
while maxD and maxD[-1][0] < x:
maxD.pop()
... | 0 | true | {
"coverage_similarity": 0,
"mutation_id": 3,
"mutation_type": "arithmetic"
} |
contest436_q3748_s0 | 3,748 | sortMatrix | def sortMatrix(grid: List[List[int]]) -> List[List[int]]:
n = len(grid)
x = 0
y = n - 1
while True:
pos = []
cur = 0
while x + cur < n and y + cur < n:
pos.append(grid[x + cur][y + cur])
cur += 1
cur = 0
... | sortMatrix(grid=[[1,7,3],[9,8,2],[4,5,6]]) | [[8, 2, 3], [9, 6, 7], [4, 5, 1]] | sortMatrix(grid=[[1,7,3],[9,8,2],[4,5,6]]) == [[8, 2, 3], [9, 6, 7], [4, 5, 1]] | weekly-contest-436 | 2025-02-09T00:00:00.000 | medium | {
"coverage": null,
"loc": 29
} | 1,536,399,828 | def sortMatrix(grid: List[List[int]]) -> List[List[int]]:
n = len(grid)
x = 0
y = n - 1
while True:
pos = []
cur = 0
while x + cur < n and y + cur < n:
pos.append(grid[x - cur][y + cur])
cur += 1
cur = 0
if y > 0:
pos.sort()
... | [[7, 6, 3], [9, 5, 7], [4, 6, 1]] | true | {
"coverage_similarity": 0,
"mutation_id": 3,
"mutation_type": "arithmetic"
} |
contest461_q3944_s0 | 3,944 | minTime | def minTime(s: str, o: List[int], k: int) -> int:
n = len(s)
l, r, a = 0, n - 1, -1
if n * (n + 1) // 2 < k:
return -1
def f(t):
b, v, p = sorted(o[:t+1]), 0, -1
for i in b:
v += (i - p) * (n - i)
p = i
retu... | minTime(s="abc", o=[1,0,2], k=2) | 0 | minTime(s="abc", o=[1,0,2], k=2) == 0 | weekly-contest-461 | 2025-08-03T00:00:00.000 | medium | {
"coverage": null,
"loc": 21
} | 1,721,336,485 | def minTime(s: str, o: List[int], k: int) -> int:
n = len(s)
l, r, a = (0, n - 1, -1)
if n // (n + 1) // 2 < k:
return -1
def f(t):
b, v, p = (sorted(o[:t + 1]), 0, -1)
for i in b:
v += (i - p) * (n - i)
p = i
return v
while l <= r:
m ... | -1 | true | {
"coverage_similarity": 0,
"mutation_id": 2,
"mutation_type": "arithmetic"
} |
contest448_q3822_s2 | 3,822 | specialGrid | def specialGrid(n: int) -> List[List[int]]:
if n==0: return [[0]]
p=self.specialGrid(n-1)
d=len(p)
b=d*d
m=[[0]*(d*2) for _ in range(d*2)]
o=[0,b,2*b,3*b]
for i in range(d):
for j in range(d):
v=p[i][j]
m[i][j+d]=o[0]+v
... | specialGrid(n=0) | [[0]] | specialGrid(n=0) == [[0]] | weekly-contest-448 | 2025-05-04T00:00:00.000 | medium | {
"coverage": null,
"loc": 15
} | 1,624,857,145 | def specialGrid(n: int) -> List[List[int]]:
if n == 0:
return [[-1]]
p = self.specialGrid(n - 1)
d = len(p)
b = d * d
m = [[0] * (d * 2) for _ in range(d * 2)]
o = [0, b, 2 * b, 3 * b]
for i in range(d):
for j in range(d):
v = p[i][j]
m[i][j + d] = o[0... | [[-1]] | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "number"
} |
contest453_q3876_s2 | 3,876 | canMakeEqual | def canMakeEqual(nums: List[int], k: int) -> bool:
n = len(nums)
for x in (1, -1):
c = 0
r = 0
arr = [0] * (n + 2)
for i in range(n):
c += arr[i]
if nums[i] * (1 if c % 2 == 0 else -1) != x:
if i == n -... | canMakeEqual(nums=[1,-1,1,-1,1], k=3) | True | canMakeEqual(nums=[1,-1,1,-1,1], k=3) == True | weekly-contest-453 | 2025-06-08T00:00:00.000 | medium | {
"coverage": null,
"loc": 21
} | 1,657,152,717 | def canMakeEqual(nums: List[int], k: int) -> bool:
n = len(nums)
for x in (1, -1):
c = 0
r = 0
arr = [0] * (n + 2)
for i in range(n):
c += arr[i]
if nums[i] * (1 if c % 2 == 0 else -1) != x:
if i == n - 1 or r == k:
brea... | False | true | {
"coverage_similarity": 0,
"mutation_id": 5,
"mutation_type": "arithmetic"
} |
contest462_q3959_s1 | 3,959 | maxTotal | def maxTotal(value: List[int], limit: List[int]) -> int:
d = defaultdict(list)
for v,l in zip(value,limit):
heappush(d[l],v)
if len(d[l]) > l:
heappop(d[l])
return sum(map(sum,d.values())) | maxTotal(value=[3,5,8], limit=[2,1,3]) | 16 | maxTotal(value=[3,5,8], limit=[2,1,3]) == 16 | weekly-contest-462 | 2025-08-10T00:00:00.000 | medium | {
"coverage": null,
"loc": 7
} | 1,729,555,230 | def maxTotal(value: List[int], limit: List[int]) -> int:
d = defaultdict(list)
for v, l in zip(value, limit):
heappush(d[l], v)
if len(d[l]) >= l:
heappop(d[l])
return sum(map(sum, d.values())) | 11 | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "relational"
} |
contest442_q3809_s0 | 3,809 | numberOfComponents | def numberOfComponents(props, k):
n = len(props)
uf = list(range(n))
def find(u):
if uf[u] != u:
uf[u] = find(uf[u])
return uf[u]
def uni(u, v):
pu, pv = find(u), find(v)
m = pu if pu < pv else pv
... | numberOfComponents(props=[[1,2],[1,1],[3,4],[4,5],[5,6],[7,7]], k=1) | 3 | numberOfComponents(props=[[1,2],[1,1],[3,4],[4,5],[5,6],[7,7]], k=1) == 3 | weekly-contest-442 | 2025-03-23T00:00:00.000 | medium | {
"coverage": null,
"loc": 41
} | 1,582,812,387 | def numberOfComponents(props, k):
n = len(props)
uf = list(range(n))
def find(u):
if uf[u] != u:
uf[u] = find(uf[u])
return uf[u]
def uni(u, v):
pu, pv = (find(u), find(v))
m = pu if pu < pv else pv
uf[pu] = m
uf[pv] = m
def inter(a, b, ... | 4 | true | {
"coverage_similarity": 0,
"mutation_id": 3,
"mutation_type": "relational"
} |
contest434_q3751_s2 | 3,751 | maxFrequency | def maxFrequency(nums: List[int], k: int) -> int:
import sys
def count_k_occurrences(nums: List[int], k: int) -> int:
return sum(1 for x in nums if x == k)
def build_array(nums: List[int], k: int, v: int) -> List[int]:
return [1 if x == v else -1 if ... | maxFrequency(nums=[1,2,3,4,5,6], k=1) | 2 | maxFrequency(nums=[1,2,3,4,5,6], k=1) == 2 | weekly-contest-434 | 2025-01-26T00:00:00.000 | medium | {
"coverage": null,
"loc": 40
} | 1,520,602,804 | def maxFrequency(nums: List[int], k: int) -> int:
import sys
def count_k_occurrences(nums: List[int], k: int) -> int:
return sum((1 for x in nums if x == k))
def build_array(nums: List[int], k: int, v: int) -> List[int]:
return [1 if x == v else -1 if x == k else 0 for x in nums]
def ... | 0 | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "arithmetic"
} |
contest465_q3947_s2 | 3,947 | minDifference | def minDifference(n: int, k: int) -> List[int]:
def factors(x: int) -> List[int]:
s = set(reduce(list.__add__, ([i, x // i] for i in range(1, int(x ** 0.5) + 1) if x % i == 0)))
return sorted(s)
f = factors(n)
@cache
def dfs(rr: int, rem_k: int, prev: int):
... | minDifference(n=100, k=2) | [10, 10] | minDifference(n=100, k=2) == [10, 10] | weekly-contest-465 | 2025-08-31T00:00:00.000 | medium | {
"coverage": null,
"loc": 30
} | 1,754,190,490 | def minDifference(n: int, k: int) -> List[int]:
def factors(x: int) -> List[int]:
s = set(reduce(list.__add__, ([i, x // i] for i in range(1, int(x ** 0.5) - 1) if x % i == 0)))
return sorted(s)
f = factors(n)
@cache
def dfs(rr: int, rem_k: int, prev: int):
if rem_k == 1:
... | [5, 20] | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "arithmetic"
} |
contest445_q3812_s0 | 3,812 | smallestPalindrome | def smallestPalindrome(s: str) -> str:
freq = [0] * 26
for ch in s:
freq[ord(ch) - ord('a')] += 1
center = ""
for i in range(26):
if freq[i] % 2 == 1:
center = chr(i + ord('a'))
freq[i] -= 1
break
... | smallestPalindrome(s="z") | 'z' | smallestPalindrome(s="z") == 'z' | weekly-contest-445 | 2025-04-13T00:00:00.000 | medium | {
"coverage": null,
"loc": 19
} | 1,605,113,299 | def smallestPalindrome(s: str) -> str:
freq = [0] * 26
for ch in s:
freq[ord(ch) - ord('a')] += 1
center = ''
for i in range(26):
if freq[i] // 2 == 1:
center = chr(i + ord('a'))
freq[i] -= 1
break
first_half = []
for i in range(26):
fi... | '' | true | {
"coverage_similarity": 0,
"mutation_id": 2,
"mutation_type": "arithmetic"
} |
contest448_q3822_s0 | 3,822 | specialGrid | def specialGrid(N: int) -> List[List[int]]:
grid = [[0]]
for _ in range(N):
m = len(grid)
M = m * m
size = m * 2
new = [[0] * size for _ in range(size)]
for i in range(m):
for j in range(m):
v = grid[i][j]
... | specialGrid(N=0) | [[0]] | specialGrid(N=0) == [[0]] | weekly-contest-448 | 2025-05-04T00:00:00.000 | medium | {
"coverage": null,
"loc": 16
} | 1,624,861,294 | def specialGrid(N: int) -> List[List[int]]:
grid = [[1]]
for _ in range(N):
m = len(grid)
M = m * m
size = m * 2
new = [[0] * size for _ in range(size)]
for i in range(m):
for j in range(m):
v = grid[i][j]
new[i][j + m] = v + 0 ... | [[1]] | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "number"
} |
contest464_q3979_s1 | 3,979 | partitionArray | def partitionArray(nums: List[int], k: int) -> bool:
n = len(nums)
if n % k != 0:
return False
groups = n // k
freq = Counter(nums)
return all(count <= groups for count in freq.values()) | partitionArray(nums=[1,2,3,4], k=2) | True | partitionArray(nums=[1,2,3,4], k=2) == True | weekly-contest-464 | 2025-08-24T00:00:00.000 | medium | {
"coverage": null,
"loc": 9
} | 1,745,988,949 | def partitionArray(nums: List[int], k: int) -> bool:
n = len(nums)
if n // k != 0:
return False
groups = n // k
freq = Counter(nums)
return all((count <= groups for count in freq.values())) | False | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest445_q3812_s1 | 3,812 | smallestPalindrome | def smallestPalindrome(s: str) -> str:
charCount = {}
for char in s:
charCount[char] = charCount.get(char, 0) + 1
oddChar = None
for char, count in charCount.items():
if count % 2 == 1:
if oddChar is None or char < oddChar:
... | smallestPalindrome(s="z") | 'z' | smallestPalindrome(s="z") == 'z' | weekly-contest-445 | 2025-04-13T00:00:00.000 | medium | {
"coverage": null,
"loc": 24
} | 1,605,120,842 | def smallestPalindrome(s: str) -> str:
charCount = {}
for char in s:
charCount[char] = charCount.get(char, 0) + 1
oddChar = None
for char, count in charCount.items():
if count // 2 == 1:
if oddChar is None or char < oddChar:
oddChar = char
leftHalf = []
... | '' | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "arithmetic"
} |
contest436_q3760_s2 | 3,760 | assignElements | def assignElements(groups: List[int], elements: List[int]) -> List[int]:
seen = set()
T = max(groups)
pre = [-1] * (T + 1)
for u, e in enumerate(elements):
if e in seen:
continue
seen.add(e)
i = e
while i <= T:
... | assignElements(groups=[8,4,3,2,4], elements=[4,2]) | [0, 0, -1, 1, 0] | assignElements(groups=[8,4,3,2,4], elements=[4,2]) == [0, 0, -1, 1, 0] | weekly-contest-436 | 2025-02-09T00:00:00.000 | medium | {
"coverage": null,
"loc": 18
} | 1,536,457,071 | def assignElements(groups: List[int], elements: List[int]) -> List[int]:
seen = set()
T = max(groups)
pre = [-1] * (T + 1)
for u, e in enumerate(elements):
if e in seen:
continue
seen.add(e)
i = e
while i < T:
if pre[i] == -1:
pre[i... | [-1, 0, -1, 1, 0] | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "relational"
} |
contest466_q3999_s2 | 3,999 | minOperations | def minOperations(s: str) -> int:
m = 26
for ch in s:
if ch != 'a':
v = ord(ch) - 97
if v < m:
m = v
return 0 if m == 26 else 26 - m | minOperations(s="yz") | 2 | minOperations(s="yz") == 2 | weekly-contest-466 | 2025-09-07T00:00:00.000 | medium | {
"coverage": null,
"loc": 8
} | 1,762,067,280 | def minOperations(s: str) -> int:
m = 26
for ch in s:
if ch != 'a':
v = ord(ch) + 97
if v < m:
m = v
return 0 if m == 26 else 26 - m | 0 | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest467_q3873_s2 | 3,873 | subsequenceSumAfterCapping | def subsequenceSumAfterCapping(nums: List[int], k: int) -> List[bool]:
K = k
nums.sort()
N = len(nums)
dp = [0]*(k+1)
j = 0
dp[0] = 1
Z = 1
res = []
for i in range(1,N+1):
while j < len(nums) and nums[j] < i:
Z |= (Z <<... | subsequenceSumAfterCapping(nums=[4,3,2,4], k=5) | [False, False, True, True] | subsequenceSumAfterCapping(nums=[4,3,2,4], k=5) == [False, False, True, True] | weekly-contest-467 | 2025-09-14T00:00:00.000 | medium | {
"coverage": null,
"loc": 32
} | 1,769,965,337 | def subsequenceSumAfterCapping(nums: List[int], k: int) -> List[bool]:
K = k
nums.sort()
N = len(nums)
dp = [0] * (k + 1)
j = 0
dp[0] = 1
Z = 1
res = []
for i in range(1, N - 1):
while j < len(nums) and nums[j] < i:
Z |= Z << nums[j]
j += 1
rem... | [False, False] | true | {
"coverage_similarity": 0,
"mutation_id": 2,
"mutation_type": "arithmetic"
} |
contest456_q3913_s2 | 3,913 | minXor | def minXor(nums: List[int], k: int) -> int:
n = len(nums)
prefix = [0] * (n + 1)
for i in range(1, n + 1):
prefix[i] = prefix[i - 1] ^ nums[i - 1]
inf = 10**18
dp = [[inf] * (k + 1) for _ in range(n + 1)]
dp[0][0] = 0
for i in range(1, n + 1):
... | minXor(nums=[1,2,3], k=2) | 1 | minXor(nums=[1,2,3], k=2) == 1 | weekly-contest-456 | 2025-06-29T00:00:00.000 | medium | {
"coverage": null,
"loc": 21
} | 1,679,840,404 | def minXor(nums: List[int], k: int) -> int:
n = len(nums)
prefix = [0] * (n + 1)
for i in range(1, n - 1):
prefix[i] = prefix[i - 1] ^ nums[i - 1]
inf = 10 ** 18
dp = [[inf] * (k + 1) for _ in range(n + 1)]
dp[0][0] = 0
for i in range(1, n + 1):
dp[i][1] = prefix[i]
for j... | 0 | true | {
"coverage_similarity": 0,
"mutation_id": 2,
"mutation_type": "arithmetic"
} |
contest453_q3864_s0 | 3,864 | countPermutations | def countPermutations(c: List[int]) -> int:
mod = 10**9+7
n = len(c)
for i in range(1, n):
if c[i] <= c[0]:
return 0
res = 1
for i in range(1, n):
res = res * i % mod
return res | countPermutations(c=[1,2,3]) | 2 | countPermutations(c=[1,2,3]) == 2 | weekly-contest-453 | 2025-06-08T00:00:00.000 | medium | {
"coverage": null,
"loc": 10
} | 1,657,151,639 | def countPermutations(c: List[int]) -> int:
mod = 10 ** 9 + 7
n = len(c)
for i in range(1, n):
if c[i] <= c[0]:
return 0
res = 1
for i in range(1, n):
res = res * i // mod
return res | 0 | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "arithmetic"
} |
contest440_q3791_s1 | 3,791 | numOfUnplacedFruits | def numOfUnplacedFruits(fruits, baskets):
n = len(baskets)
treeSize = 1
while treeSize < n:
treeSize *= 2
tree = [0] * (2 * treeSize)
i = 0
while i < n:
tree[treeSize + i] = baskets[i]
i += 1
i = n
while i < treeSize:
... | numOfUnplacedFruits(fruits=[4,2,5], baskets=[3,5,4]) | 1 | numOfUnplacedFruits(fruits=[4,2,5], baskets=[3,5,4]) == 1 | weekly-contest-440 | 2025-03-09T00:00:00.000 | medium | {
"coverage": null,
"loc": 57
} | 1,567,569,757 | def numOfUnplacedFruits(fruits, baskets):
n = len(baskets)
treeSize = 1
while treeSize < n:
treeSize *= 2
tree = [0] * (2 * treeSize)
i = 0
while i < n:
tree[treeSize - i] = baskets[i]
i += 1
i = n
while i < treeSize:
tree[treeSize + i] = 0
i += 1
... | 2 | true | {
"coverage_similarity": 0,
"mutation_id": 2,
"mutation_type": "arithmetic"
} |
contest453_q3864_s1 | 3,864 | countPermutations | def countPermutations(complexity: List[int]) -> int:
MOD = 10**9 + 7
n = len(complexity)
# check feasibility: comp[0] must be strictly the smallest
root = complexity[0]
for x in complexity[1:]:
if x <= root:
return 0
# all other n−1 computers... | countPermutations(complexity=[1,2,3]) | 2 | countPermutations(complexity=[1,2,3]) == 2 | weekly-contest-453 | 2025-06-08T00:00:00.000 | medium | {
"coverage": null,
"loc": 15
} | 1,657,189,523 | def countPermutations(complexity: List[int]) -> int:
MOD = 10 ** 9 + 7
n = len(complexity)
root = complexity[0]
for x in complexity[1:]:
if x <= root:
return 0
res = 1
for k in range(1, n):
res = res * k // MOD
return res | 0 | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "arithmetic"
} |
contest453_q3876_s0 | 3,876 | canMakeEqual | def canMakeEqual(nums: List[int], k: int) -> bool:
n = len(nums)
for t in (1, -1):
b = [1 if nums[i] != t else 0 for i in range(n)]
cnt = 0
for i in range(n - 1):
if b[i]:
cnt += 1
b[i] = 0
b[... | canMakeEqual(nums=[1,-1,1,-1,1], k=3) | True | canMakeEqual(nums=[1,-1,1,-1,1], k=3) == True | weekly-contest-453 | 2025-06-08T00:00:00.000 | medium | {
"coverage": null,
"loc": 13
} | 1,657,158,036 | def canMakeEqual(nums: List[int], k: int) -> bool:
n = len(nums)
for t in (1, -1):
b = [1 if nums[i] != t else 0 for i in range(n)]
cnt = 0
for i in range(n - 1):
if b[i]:
cnt += 1
b[i] = 0
b[i + 1] ^= 1
if b[-1] == 0 an... | False | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "keyword"
} |
contest442_q3794_s1 | 3,794 | minTime | def minTime(skill: List[int], mana: List[int]) -> int:
n, m = len(skill), len(mana)
ss = [0] * n
ss[0] = skill[0]
for i in range(1, n):
ss[i] = ss[i - 1] + skill[i]
S = 0
for j in range(1, m):
delay = skill[0] * mana[j - 1]
for i in ran... | minTime(skill=[1,5,2,4], mana=[5,1,4,2]) | 110 | minTime(skill=[1,5,2,4], mana=[5,1,4,2]) == 110 | weekly-contest-442 | 2025-03-23T00:00:00.000 | medium | {
"coverage": null,
"loc": 15
} | 1,582,823,640 | def minTime(skill: List[int], mana: List[int]) -> int:
n, m = (len(skill), len(mana))
ss = [0] * n
ss[0] = skill[0]
for i in range(1, n):
ss[i] = ss[i - 1] - skill[i]
S = 0
for j in range(1, m):
delay = skill[0] * mana[j - 1]
for i in range(1, n):
d = ss[i] * ... | 3 | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "arithmetic"
} |
contest446_q3831_s1 | 3,831 | resultArray | def resultArray(nums: List[int], k: int) -> List[int]:
res = [0] * k
dp = [0] * k
for a in nums:
ndp = [0] * k
am = a % k
ndp[am] += 1
for r in range(k):
if dp[r]:
ndp[(r * am) % k] += dp[r]
for r in ... | resultArray(nums=[1,2,3,4,5], k=3) | [9, 2, 4] | resultArray(nums=[1,2,3,4,5], k=3) == [9, 2, 4] | weekly-contest-446 | 2025-04-20T00:00:00.000 | medium | {
"coverage": null,
"loc": 14
} | 1,612,015,311 | def resultArray(nums: List[int], k: int) -> List[int]:
res = [0] * k
dp = [0] * k
for a in nums:
ndp = [0] * k
am = a // k
ndp[am] += 1
for r in range(k):
if dp[r]:
ndp[r * am % k] += dp[r]
for r in range(k):
res[r] += ndp[r]
... | [9, 6, 0] | true | {
"coverage_similarity": 0,
"mutation_id": 3,
"mutation_type": "arithmetic"
} |
contest435_q3754_s0 | 3,754 | maxDistance | def maxDistance(s: str, k: int) -> int:
res = 0
e = w = n = s_count = 0
for i, ch in enumerate(s, 1):
if ch == 'E': e += 1
elif ch == 'W': w += 1
elif ch == 'N': n += 1
else: s_count += 1
bx = abs(e - w)
hx = min(e, w)
... | maxDistance(s="NWSE", k=1) | 3 | maxDistance(s="NWSE", k=1) == 3 | weekly-contest-435 | 2025-02-02T00:00:00.000 | medium | {
"coverage": null,
"loc": 16
} | 1,528,089,568 | def maxDistance(s: str, k: int) -> int:
res = 0
e = w = n = s_count = 0
for i, ch in enumerate(s, 1):
if ch == 'E':
e += 1
elif ch == 'W':
w += 1
elif ch == 'N':
n += 1
else:
s_count += 1
bx = abs(e + w)
hx = min... | 4 | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest458_q3930_s2 | 3,930 | maxLen | def maxLen(n: int, edges: List[List[int]], label: str) -> int:
adj = [[] for _ in range(n)]
for u,v in edges:
adj[u].append(v)
adj[v].append(u)
# bucket neighbors by character
from collections import defaultdict
buckets = [defaultdict(list) for _ in range(... | maxLen(n=3, edges=[[0,1],[1,2]], label="aba") | 3 | maxLen(n=3, edges=[[0,1],[1,2]], label="aba") == 3 | weekly-contest-458 | 2025-07-13T00:00:00.000 | hard | {
"coverage": null,
"loc": 47
} | 1,695,835,727 | def maxLen(n: int, edges: List[List[int]], label: str) -> int:
adj = [[] for _ in range(n)]
for u, v in edges:
adj[u].append(v)
adj[v].append(u)
from collections import defaultdict
buckets = [defaultdict(list) for _ in range(n)]
for u in range(n):
for w in adj[u]:
... | 1 | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "arithmetic"
} |
contest461_q3956_s0 | 3,956 | maxSumTrionic | def maxSumTrionic(a: List[int]) -> int:
n = len(a)
pre = [0] * (n + 1)
inc = [1] * n
dec = [1] * n
inc2 = [1] * n
p = [0] * (n + 2)
lg = p[:]
m = len(p).bit_length()
mn = [[0] * (n + 1) for _ in range(m)]
mx = [[0] * (n + 1) for _ in range(... | maxSumTrionic(a=[0,-2,-1,-3,0,2,-1]) | -4 | maxSumTrionic(a=[0,-2,-1,-3,0,2,-1]) == -4 | weekly-contest-461 | 2025-08-03T00:00:00.000 | hard | {
"coverage": null,
"loc": 63
} | 1,721,337,543 | def maxSumTrionic(a: List[int]) -> int:
n = len(a)
pre = [0] * (n + 1)
inc = [1] * n
dec = [1] * n
inc2 = [1] * n
p = [0] * (n + 2)
lg = p[:]
m = len(p).bit_length()
mn = [[0] * (n + 1) for _ in range(m)]
mx = [[0] * (n + 1) for _ in range(m)]
inf = sys.maxsize
ninf = -in... | 1 | true | {
"coverage_similarity": 0,
"mutation_id": 11,
"mutation_type": "arithmetic"
} |
contest439_q3770_s2 | 3,770 | generateString | def generateString(str1: str, str2: str) -> str:
n, m = len(str1), len(str2)
L = n + m - 1
res = [None] * L
free = [True] * L
for i in range(n):
if str1[i] == 'T':
for j in range(m):
pos = i + j
c = str2... | generateString(str1="TFTF", str2="ab") | 'ababa' | generateString(str1="TFTF", str2="ab") == 'ababa' | weekly-contest-439 | 2025-03-02T00:00:00.000 | hard | {
"coverage": null,
"loc": 42
} | 1,559,848,310 | def generateString(str1: str, str2: str) -> str:
n, m = (len(str1), len(str2))
L = n + m + 1
res = [None] * L
free = [True] * L
for i in range(n):
if str1[i] == 'T':
for j in range(m):
pos = i + j
c = str2[j]
if res[pos] is None:
... | 'ababaaa' | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest456_q3902_s1 | 3,902 | maxStability | def maxStability(n: int, e: list[list[int]], k: int) -> int:
class D:
def __init__(s, z): s.p, s.c = list(range(z)), z
def f(s, i): s.p[i] = s.f(s.p[i]) if s.p[i] != i else i; return s.p[i]
def u(s, i, j):
x, y = s.f(i), s.f(j)
if x != y: s.p[y] = x; s.c -= 1; return 1
retu... | maxStability(n=3, e=[[0,1,2,1],[1,2,3,0]], k=1) | 2 | maxStability(n=3, e=[[0,1,2,1],[1,2,3,0]], k=1) == 2 | weekly-contest-456 | 2025-06-29T00:00:00.000 | hard | {
"coverage": null,
"loc": 38
} | 1,679,836,304 | def maxStability(n: int, e: list[list[int]], k: int) -> int:
class D:
def __init__(s, z):
s.p, s.c = (list(range(z)), z)
def f(s, i):
s.p[i] = s.f(s.p[i]) if s.p[i] != i else i
return s.p[i]
def u(s, i, j):
x, y = (s.f(i), s.f(j))
... | 1 | true | {
"coverage_similarity": 0,
"mutation_id": 2,
"mutation_type": "arithmetic"
} |
contest443_q3808_s2 | 3,808 | longestPalindrome | def longestPalindrome(s: str, t: str) -> int:
n, m = len(s), len(t)
# --- Precompute palindromic substrings for s ---
# isPalS[i][j] = True if s[i:j+1] is a palindrome.
isPalS = [[False] * n for _ in range(n)]
for i in range(n-1, -1, -1):
for j in range(i, n):
... | longestPalindrome(s="a", t="a") | 2 | longestPalindrome(s="a", t="a") == 2 | weekly-contest-443 | 2025-03-30T00:00:00.000 | hard | {
"coverage": null,
"loc": 72
} | 1,590,627,076 | def longestPalindrome(s: str, t: str) -> int:
n, m = (len(s), len(t))
isPalS = [[False] * n for _ in range(n)]
for i in range(n - 1, -1, -1):
for j in range(i, n):
if s[i] == s[j] and (j - i < 2 or isPalS[i + 1][j - 1]):
isPalS[i][j] = True
best_start = [0] * n
fo... | 1 | true | {
"coverage_similarity": 0,
"mutation_id": 20,
"mutation_type": "arithmetic"
} |
contest439_q3770_s1 | 3,770 | generateString | def generateString(str1: str, str2: str) -> str:
n, m = len(str1), len(str2)
L = n + m - 1
word = [None] * L
fixed = [False] * L
for i in range(n):
if str1[i] == 'T':
for j in range(m):
pos = i + j
if word[pos] ... | generateString(str1="TFTF", str2="ab") | 'ababa' | generateString(str1="TFTF", str2="ab") == 'ababa' | weekly-contest-439 | 2025-03-02T00:00:00.000 | hard | {
"coverage": null,
"loc": 36
} | 1,559,842,202 | def generateString(str1: str, str2: str) -> str:
n, m = (len(str1), len(str2))
L = n + m + 1
word = [None] * L
fixed = [False] * L
for i in range(n):
if str1[i] == 'T':
for j in range(m):
pos = i + j
if word[pos] is not None and word[pos] != str2[j... | 'ababaaa' | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest453_q3866_s0 | 3,866 | minOperations | def minOperations(w1: str,w2: str) -> int:
n = len(w1)
s = [ord(c)-97 for c in w1]
t = [ord(c)-97 for c in w2]
INF = 10**9
dp = [INF]*(n+1)
dp[0] = 0
for i in range(n):
for j in range(i,n):
m = 0
cnt = {}
... | minOperations(w1="abcdf", w2="dacbe") | 4 | minOperations(w1="abcdf", w2="dacbe") == 4 | weekly-contest-453 | 2025-06-08T00:00:00.000 | hard | {
"coverage": null,
"loc": 40
} | 1,657,170,503 | def minOperations(w1: str, w2: str) -> int:
n = len(w1)
s = [ord(c) + 97 for c in w1]
t = [ord(c) - 97 for c in w2]
INF = 10 ** 9
dp = [INF] * (n + 1)
dp[0] = 0
for i in range(n):
for j in range(i, n):
m = 0
cnt = {}
for k in range(i, j + 1):
... | 5 | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest449_q3845_s1 | 3,845 | maxScore | def maxScore(n: int, edges: List[List[int]]) -> int:
G = [[] for _ in range(n)]
D = [0] * n
for u, v in edges:
G[u].append(v)
G[v].append(u)
D[u] += 1
D[v] += 1
seen = [0] * n
cp = []
for i in range(n):
if seen[... | maxScore(n=4, edges=[[0,1],[1,2],[2,3]]) | 23 | maxScore(n=4, edges=[[0,1],[1,2],[2,3]]) == 23 | weekly-contest-449 | 2025-05-11T00:00:00.000 | hard | {
"coverage": null,
"loc": 80
} | 1,630,614,540 | def maxScore(n: int, edges: List[List[int]]) -> int:
G = [[] for _ in range(n)]
D = [0] * n
for u, v in edges:
G[u].append(v)
G[v].append(u)
D[u] += 1
D[v] += 1
seen = [0] * n
cp = []
for i in range(n):
if seen[i]:
continue
_t = [i]
... | 1 | true | {
"coverage_similarity": 0,
"mutation_id": 6,
"mutation_type": "arithmetic"
} |
contest445_q3813_s0 | 3,813 | smallestPalindrome | def smallestPalindrome(s: str, k: int) -> str:
freq = [0] * 26
for ch in s:
freq[ord(ch) - ord('a')] += 1
half_counts = [count // 2 for count in freq]
L = sum(half_counts)
center = ""
for i in range(26):
if freq[i] % 2 == 1:
center... | smallestPalindrome(s="abba", k=2) | 'baab' | smallestPalindrome(s="abba", k=2) == 'baab' | weekly-contest-445 | 2025-04-13T00:00:00.000 | hard | {
"coverage": null,
"loc": 45
} | 1,605,121,925 | def smallestPalindrome(s: str, k: int) -> str:
freq = [0] * 26
for ch in s:
freq[ord(ch) - ord('a')] += 1
half_counts = [count * 2 for count in freq]
L = sum(half_counts)
center = ''
for i in range(26):
if freq[i] % 2 == 1:
center = chr(i + ord('a'))
break... | 'aaababbbbbbabaaa' | true | {
"coverage_similarity": 0,
"mutation_id": 2,
"mutation_type": "arithmetic"
} |
contest467_q4027_s1 | 4,027 | countStableSubsequences | def countStableSubsequences(nums: List[int]) -> int:
MOD = 1_000_000_007
E1 = E2 = O1 = O2 = 0
for a in nums:
if a % 2 == 0:
newE1 = (E1 + O1 + O2 + 1) % MOD
newE2 = (E2 + E1) % MOD
E1, E2 = newE1, newE2
else:
newO1 = (O1 + E1 + E2 + 1) % MOD
... | countStableSubsequences(nums=[1,3,5]) | 6 | countStableSubsequences(nums=[1,3,5]) == 6 | weekly-contest-467 | 2025-09-14T00:00:00.000 | hard | {
"coverage": null,
"loc": 14
} | 1,769,973,511 | def countStableSubsequences(nums: List[int]) -> int:
MOD = 1000000007
E1 = E2 = O1 = O2 = 0
for a in nums:
if a // 2 == 0:
newE1 = (E1 + O1 + O2 + 1) % MOD
newE2 = (E2 + E1) % MOD
E1, E2 = (newE1, newE2)
else:
newO1 = (O1 + E1 + E2 + 1) % MOD
... | 7 | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest457_q3922_s2 | 3,922 | minMoves | def minMoves(sx: int, sy: int, tx: int, ty: int) -> int:
if sx == tx and sy == ty:
return 0
if sx == 0 and sy == 0:
return -1
q = deque([(tx, ty, 0)])
seen = {(tx, ty)}
while q:
x, y, d = q.popleft()
if x == sx and y == sy:
... | minMoves(sx=1, sy=2, tx=5, ty=4) | 2 | minMoves(sx=1, sy=2, tx=5, ty=4) == 2 | weekly-contest-457 | 2025-07-06T00:00:00.000 | hard | {
"coverage": null,
"loc": 39
} | 1,687,870,593 | def minMoves(sx: int, sy: int, tx: int, ty: int) -> int:
if sx == tx and sy == ty:
return 0
if sx == 0 and sy == 0:
return -1
q = deque([(tx, ty, 0)])
seen = {(tx, ty)}
while q:
x, y, d = q.popleft()
if x == sx and y == sy:
return d
if x < sx or y ... | -1 | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "arithmetic"
} |
contest442_q3744_s2 | 3,744 | minOperations | def minOperations(queries: List[List[int]]) -> int:
result = []
k = 1
while True:
low = 4 ** (k - 1)
high = 4 ** k - 1
if low > 10 ** 9:
break
result.append((low, high, k))
k += 1
# print(result)
ans = 0... | minOperations(queries=[[1,2],[2,4]]) | 3 | minOperations(queries=[[1,2],[2,4]]) == 3 | weekly-contest-442 | 2025-03-23T00:00:00.000 | hard | {
"coverage": null,
"loc": 27
} | 1,582,837,946 | def minOperations(queries: List[List[int]]) -> int:
result = []
k = 1
while True:
low = 4 ** (k + 1)
high = 4 ** k - 1
if low > 10 ** 9:
break
result.append((low, high, k))
k += 1
ans = 0
for q in queries:
l = q[0]
r = q[1]
... | 0 | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest447_q3852_s0 | 3,852 | pathExistenceQueries | def pathExistenceQueries(n: int, nums: List[int], maxDiff: int, queries: List[List[int]]) -> List[int]:
arr = [(nums[i], i) for i in range(n)]
arr.sort(key=lambda x: x[0])
sv = [a for a, _ in arr]
si = [i for _, i in arr]
pos = [0] * n
for j in range(n):
pos[s... | pathExistenceQueries(n=5, nums=[1,8,3,4,2], maxDiff=3, queries=[[0,3],[2,4]]) | [1, 1] | pathExistenceQueries(n=5, nums=[1,8,3,4,2], maxDiff=3, queries=[[0,3],[2,4]]) == [1, 1] | weekly-contest-447 | 2025-04-27T00:00:00.000 | hard | {
"coverage": null,
"loc": 46
} | 1,618,879,937 | def pathExistenceQueries(n: int, nums: List[int], maxDiff: int, queries: List[List[int]]) -> List[int]:
arr = [(nums[i], i) for i in range(n)]
arr.sort(key=lambda x: x[0])
sv = [a for a, _ in arr]
si = [i for _, i in arr]
pos = [0] * n
for j in range(n):
pos[si[j]] = j
comp = [0] * n... | [-1, -1] | true | {
"coverage_similarity": 0,
"mutation_id": 4,
"mutation_type": "arithmetic"
} |
contest435_q3761_s0 | 3,761 | maxDifference | def maxDifference(s: str, k: int) -> int:
INF = 10**9
n = len(s)
ans = -10**9
for x in range(5):
for y in range(5):
if x == y:
continue
N = n + 1
D = [0] * N
PX = [0] * N
PY = ... | maxDifference(s="12233", k=4) | -1 | maxDifference(s="12233", k=4) == -1 | weekly-contest-435 | 2025-02-02T00:00:00.000 | hard | {
"coverage": null,
"loc": 49
} | 1,528,104,807 | def maxDifference(s: str, k: int) -> int:
INF = 10 ** 9
n = len(s)
ans = -10 ** 9
for x in range(5):
for y in range(5):
if x == y:
continue
N = n + 1
D = [0] * N
PX = [0] * N
PY = [0] * N
CNT = [0] * N
... | 2 | true | {
"coverage_similarity": 0,
"mutation_id": 5,
"mutation_type": "arithmetic"
} |
contest443_q3808_s0 | 3,808 | longestPalindrome | def longestPalindrome(s: str, t: str) -> int:
n, m = len(s), len(t)
palS = [[False] * n for _ in range(n)]
for i in range(n):
palS[i][i] = True
for i in range(n - 1):
palS[i][i + 1] = (s[i] == s[i + 1])
for length in range(3, n + 1):
for i in r... | longestPalindrome(s="a", t="a") | 2 | longestPalindrome(s="a", t="a") == 2 | weekly-contest-443 | 2025-03-30T00:00:00.000 | hard | {
"coverage": null,
"loc": 62
} | 1,590,625,901 | def longestPalindrome(s: str, t: str) -> int:
n, m = (len(s), len(t))
palS = [[False] * n for _ in range(n)]
for i in range(n):
palS[i][i] = True
for i in range(n - 1):
palS[i][i + 1] = s[i] == s[i + 1]
for length in range(3, n + 1):
for i in range(n - length + 1):
... | 1 | true | {
"coverage_similarity": 0,
"mutation_id": 32,
"mutation_type": "arithmetic"
} |
contest433_q3725_s0 | 3,725 | minMaxSubarraySum | def minMaxSubarraySum(nums, k):
def p(L,R,M):
u=min(L,M-1)
if u<=0:return 0
if R>=M-1:return M*u - u*(u+1)//2
x=M-R
if x>u:return R*u
s=R*(x-1)
s+=M*(u-x+1)-((u*(u+1))//2-((x-1)*x)//2)
return s
def s(a,k,m):
... | minMaxSubarraySum(nums=[1,2,3], k=2) | 20 | minMaxSubarraySum(nums=[1,2,3], k=2) == 20 | weekly-contest-433 | 2025-01-19T00:00:00.000 | hard | {
"coverage": null,
"loc": 31
} | 1,513,090,643 | def minMaxSubarraySum(nums, k):
def p(L, R, M):
u = min(L, M - 1)
if u <= 0:
return 0
if R >= M - 1:
return M * u + u * (u + 1) // 2
x = M - R
if x > u:
return R * u
s = R * (x - 1)
s += M * (u - x + 1) - (u * (u + 1) // 2 ... | 26 | true | {
"coverage_similarity": 0,
"mutation_id": 2,
"mutation_type": "arithmetic"
} |
contest447_q3841_s2 | 3,841 | concatenatedDivisibility | def concatenatedDivisibility(nums: List[int], k: int) -> List[int]:
n = len(nums)
FULL = (1<<n) - 1
L = [len(str(x)) for x in nums]
pow10L = [pow(10, L[i], k) for i in range(n)]
idxs = sorted(range(n), key=lambda i: nums[i])
dq = deque()
seen = set()
f... | concatenatedDivisibility(nums=[3,12,45], k=5) | [3, 12, 45] | concatenatedDivisibility(nums=[3,12,45], k=5) == [3, 12, 45] | weekly-contest-447 | 2025-04-27T00:00:00.000 | hard | {
"coverage": null,
"loc": 39
} | 1,618,878,091 | def concatenatedDivisibility(nums: List[int], k: int) -> List[int]:
n = len(nums)
FULL = (1 << n) + 1
L = [len(str(x)) for x in nums]
pow10L = [pow(10, L[i], k) for i in range(n)]
idxs = sorted(range(n), key=lambda i: nums[i])
dq = deque()
seen = set()
for i in idxs:
m = 1 << i
... | [] | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest449_q3850_s2 | 3,850 | canPartitionGrid | def canPartitionGrid(grid: List[List[int]]) -> bool:
m = len(grid)
n = len(grid[0])
total = sum(sum(row) for row in grid)
prefix = [0]*m
prefix[0] = sum(grid[0])
for i in range(1, m):
prefix[i] = prefix[i-1] + sum(grid[i])
col_sums = [0]*n
for ... | canPartitionGrid(grid=[[1,4],[2,3]]) | True | canPartitionGrid(grid=[[1,4],[2,3]]) == True | weekly-contest-449 | 2025-05-11T00:00:00.000 | hard | {
"coverage": null,
"loc": 88
} | 1,630,614,238 | def canPartitionGrid(grid: List[List[int]]) -> bool:
m = len(grid)
n = len(grid[0])
total = sum((sum(row) for row in grid))
prefix = [0] * m
prefix[0] = sum(grid[0])
for i in range(1, m):
prefix[i] = prefix[i - 1] + sum(grid[i])
col_sums = [0] * n
for j in range(n):
s = 0... | False | true | {
"coverage_similarity": 0,
"mutation_id": 7,
"mutation_type": "keyword"
} |
contest464_q3982_s0 | 3,982 | maxWalls | def maxWalls(r: List[int], d: List[int], w: List[int]) -> int:
def c(L,R):
if L>R:
return 0
return bisect_right(w,R)-bisect_left(w,L)
if not w: return 0
z=sorted(zip(r,d))
r=[p for p,_ in z]
d=[q for _,q in z]
w=sorted(w)
... | maxWalls(r=[4], d=[3], w=[1,10]) | 1 | maxWalls(r=[4], d=[3], w=[1,10]) == 1 | weekly-contest-464 | 2025-08-24T00:00:00.000 | hard | {
"coverage": null,
"loc": 53
} | 1,746,019,664 | def maxWalls(r: List[int], d: List[int], w: List[int]) -> int:
def c(L, R):
if L > R:
return 0
return bisect_right(w, R) + bisect_left(w, L)
if not w:
return 0
z = sorted(zip(r, d))
r = [p for p, _ in z]
d = [q for _, q in z]
w = sorted(w)
n = len(r)
... | 2 | true | {
"coverage_similarity": 0,
"mutation_id": 0,
"mutation_type": "arithmetic"
} |
contest436_q3696_s0 | 3,696 | countSubstrings | def countSubstrings(s: str) -> int:
n = len(s)
res = 0
mod3 = [1, 0, 0]
sum3 = 0
mod9 = [1] + [0] * 8
sum9 = 0
mod7 = [1] + [0] * 6
sum7 = 0
pow5 = 1
for i, c in enumerate(s):
d = int(c)
... | countSubstrings(s="12936") | 11 | countSubstrings(s="12936") == 11 | weekly-contest-436 | 2025-02-09T00:00:00.000 | hard | {
"coverage": null,
"loc": 64
} | 1,536,442,634 | def countSubstrings(s: str) -> int:
n = len(s)
res = 0
mod3 = [1, 0, 0]
sum3 = 0
mod9 = [1] + [0] * 8
sum9 = 0
mod7 = [1] + [0] * 6
sum7 = 0
pow5 = 1
for i, c in enumerate(s):
d = int(c)
sum3 = (sum3 + d) % 3
sum9 = (sum9 + d) // 9
sum7 = (sum7 * 1... | 10 | true | {
"coverage_similarity": 0,
"mutation_id": 6,
"mutation_type": "arithmetic"
} |
contest442_q3744_s1 | 3,744 | minOperations | def minOperations(queries: List[List[int]]) -> int:
p = [1] * 16
for i in range(1, 16):
p[i] = p[i - 1] * 4
ans = 0
for l, r in queries:
total = 0
for t in range(1, 16):
L = p[t - 1]
R = p[t] - 1
lo = l i... | minOperations(queries=[[1,2],[2,4]]) | 3 | minOperations(queries=[[1,2],[2,4]]) == 3 | weekly-contest-442 | 2025-03-23T00:00:00.000 | hard | {
"coverage": null,
"loc": 24
} | 1,582,831,208 | def minOperations(queries: List[List[int]]) -> int:
p = [1] * 16
for i in range(1, 16):
p[i] = p[i - 1] // 4
ans = 0
for l, r in queries:
total = 0
for t in range(1, 16):
L = p[t - 1]
R = p[t] - 1
lo = l if l > L else L
hi = r if r ... | 0 | true | {
"coverage_similarity": 0,
"mutation_id": 1,
"mutation_type": "arithmetic"
} |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 11