The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
Error code: DatasetGenerationError
Exception: CastError
Message: Couldn't cast
model: string
dataset: string
tag: null
n: int64
truncated: int64
no_marker: int64
multi_marker: int64
extract_fail: int64
n_scored: int64
accuracy: double
error_rate: double
mcqa_stage_counts: null
gsm8k_flexible_acc: null
pending_execution: bool
scored: timestamp[s]
executed_with: string
flag: string
tlen: int64
id: string
think_chars: int64
pred: string
ans_chars: int64
correct: bool
stage: null
to
{'id': Value('string'), 'tlen': Value('int64'), 'truncated': Value('bool'), 'flag': Value('string'), 'pred': Value('string'), 'correct': Value('bool'), 'stage': Value('null'), 'think_chars': Value('int64'), 'ans_chars': Value('int64')}
because column names don't match
Traceback: Traceback (most recent call last):
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1827, in _prepare_split_single
for key, table in generator:
^^^^^^^^^
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 613, in wrapped
for item in generator(*args, **kwargs):
~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 343, in _generate_tables
self._cast_table(pa_table, json_field_paths=json_field_paths),
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 132, in _cast_table
pa_table = table_cast(pa_table, self.info.features.arrow_schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2378, in table_cast
return cast_table_to_schema(table, schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2306, in cast_table_to_schema
raise CastError(
...<3 lines>...
)
datasets.table.CastError: Couldn't cast
model: string
dataset: string
tag: null
n: int64
truncated: int64
no_marker: int64
multi_marker: int64
extract_fail: int64
n_scored: int64
accuracy: double
error_rate: double
mcqa_stage_counts: null
gsm8k_flexible_acc: null
pending_execution: bool
scored: timestamp[s]
executed_with: string
flag: string
tlen: int64
id: string
think_chars: int64
pred: string
ans_chars: int64
correct: bool
stage: null
to
{'id': Value('string'), 'tlen': Value('int64'), 'truncated': Value('bool'), 'flag': Value('string'), 'pred': Value('string'), 'correct': Value('bool'), 'stage': Value('null'), 'think_chars': Value('int64'), 'ans_chars': Value('int64')}
because column names don't match
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1369, in compute_config_parquet_and_info_response
parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
~~~~~~~~~~~~~~~~~~~~~~~~~^
builder, max_dataset_size_bytes=max_dataset_size_bytes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 948, in stream_convert_to_parquet
builder._prepare_split(split_generator=splits_generators[split], file_format="parquet")
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1694, in _prepare_split
for job_id, done, content in self._prepare_split_single(
~~~~~~~~~~~~~~~~~~~~~~~~~~^
gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
):
^
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1880, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.exceptions.DatasetGenerationError: An error occurred while generating the datasetNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
id string | tlen int64 | truncated bool | flag string | pred string | correct bool | stage null | think_chars int64 | ans_chars int64 |
|---|---|---|---|---|---|---|---|---|
1873_A | 21,881 | false | ok | import sys
def main():
t = int(sys.stdin.readline())
for _ in range(t):
s = sys.stdin.readline().strip()
correct = (s[0] == 'a') or (s[1] == 'b') or (s[2] == 'c')
print("YES" if correct else "NO")
if __name__ == "__main__":
main() | true | null | 75,395 | 1,509 |
1873_D | 18,056 | false | ok | import sys
def main():
data = sys.stdin.read().split()
ptr = 0
t = int(data[ptr])
ptr += 1
for _ in range(t):
n = int(data[ptr])
k = int(data[ptr+1])
ptr += 2
s = data[ptr]
ptr += 1
answer = 0
i = 0
while i < n:
if s[i] == ... | true | null | 57,909 | 1,329 |
1883_C | 29,039 | false | ok | import sys
def v_p(a, p):
if a == 0:
return 0
e = 0
while a % p == 0:
e += 1
a = a // p
return e
def main():
t = int(sys.stdin.readline())
for _ in range(t):
line = sys.stdin.readline().split()
n = int(line[0])
k = int(line[1])
a = list(m... | true | null | 104,134 | 3,556 |
1899_B | 17,370 | false | ok | import sys
def main():
data = sys.stdin.read().split()
ptr = 0
t = int(data[ptr])
ptr += 1
for _ in range(t):
n = int(data[ptr])
ptr += 1
a = list(map(int, data[ptr:ptr + n]))
ptr += n
# Compute prefix sums
prefix = [0] * (n + 1)
for i in ran... | true | null | 56,650 | 2,461 |
1899_D | 29,682 | false | ok | import sys
from collections import defaultdict
def main():
t = int(sys.stdin.readline())
for _ in range(t):
n = int(sys.stdin.readline())
a = list(map(int, sys.stdin.readline().split()))
freq = defaultdict(int)
cnt1 = 0
cnt2 = 0
for num in a:
freq[num... | true | null | 78,352 | 1,710 |
2728 | 18,985 | false | ok | from typing import List
class Solution:
def matrixSum(self, nums: List[List[int]]) -> int:
for row in nums:
row.sort()
score = 0
while True:
removed = []
for row in nums:
if row:
removed.append(row.pop())
if... | true | null | 67,291 | 1,329 |
2754 | 31,017 | false | ok | from typing import List
class Solution:
def maxStrength(self, nums: List[int]) -> int:
positives = []
negatives = []
zeros = []
for num in nums:
if num > 0:
positives.append(num)
elif num < 0:
negatives.append(num)
... | true | null | 129,693 | 3,363 |
2756 | 12,718 | false | ok | from typing import List
class Solution:
def buyChoco(self, prices: List[int], money: int) -> int:
prices_sorted = sorted(prices)
min_sum = prices_sorted[0] + prices_sorted[1]
if min_sum <= money:
return money - min_sum
else:
return money | true | null | 43,652 | 1,665 |
2777 | 22,414 | false | ok | from typing import List
class Solution:
def distinctDifferenceArray(self, nums: List[int]) -> List[int]:
n = len(nums)
suffix_counts = [0] * (n + 1)
distinct_elements = set()
for i in range(n-1, -1, -1):
distinct_elements.add(nums[i])
suffix_counts[i] = len(d... | true | null | 81,013 | 1,979 |
2784 | 28,068 | false | ok | from typing import List
class Solution:
def sumOfPower(self, nums: List[int]) -> int:
MOD = 10**9 + 7
total = 0
n = len(nums)
for mask in range(1, 1 << n):
subset = []
for i in range(n):
if mask & (1 << i):
subset.append(nu... | false | null | 99,626 | 1,784 |
2786 | 25,585 | false | ok | class Solution:
def longestSemiRepetitiveSubstring(self, s: str) -> int:
n = len(s)
for length in range(n, 0, -1):
for i in range(n - length + 1):
j = i + length - 1
count = 0
for k in range(i, j):
if s[k] == s[k+1]:
... | true | null | 88,485 | 1,616 |
2792 | 19,170 | false | ok | from typing import List
class Solution:
def doesValidArrayExist(self, derived: List[int]) -> bool:
xor = 0
for num in derived:
xor ^= num
return xor == 0 | true | null | 61,470 | 1,170 |
2802 | 16,883 | false | ok | class Solution:
def punishmentNumber(self, n: int) -> int:
def is_punishment(i):
square = i * i
s = str(square)
def backtrack(start, current_sum):
if start == len(s):
return current_sum == i
for end in range(start + 1, ... | true | null | 59,459 | 2,291 |
2811 | 19,989 | false | ok | class Solution:
def minimumSum(self, n: int, k: int) -> int:
m = k // 2
if n <= m:
return n * (n + 1) // 2
else:
t = n - m
sum_first = m * (m + 1) // 2
sum_second = t * k + t * (t - 1) // 2
return sum_first + sum_second | true | null | 58,819 | 1,638 |
2816 | 18,727 | false | ok | class Solution:
def makeSmallestPalindrome(self, s: str) -> str:
chars = list(s)
n = len(chars)
for i in range(n // 2):
j = n - 1 - i
if chars[i] != chars[j]:
if chars[i] < chars[j]:
chars[j] = chars[i]
else:
... | true | null | 66,374 | 1,806 |
2819 | 18,401 | false | ok | class Solution:
def removeTrailingZeros(self, num: str) -> str:
return num.rstrip('0') | true | null | 54,014 | 713 |
2825 | 21,595 | false | ok | from collections import defaultdict
class Solution:
def minimizedStringLength(self, s: str) -> int:
char_indices = defaultdict(list)
for idx, char in enumerate(s):
char_indices[char].append(idx)
total_blocks = 0
for char in char_indices:
indices = sorted(cha... | false | null | 82,627 | 1,641 |
2828 | 28,492 | false | ok | def prev_char(c):
if c == 'a':
return 'z'
else:
return chr(ord(c) - 1)
def smallestString(s: str) -> str:
n = len(s)
min_str = None
for i in range(n):
for j in range(i, n):
t = list(s)
for k in range(i, j+1):
t[k] = prev_char(t[k])
... | false | null | 114,976 | 1,326 |
2832 | 19,199 | false | ok | from collections import defaultdict
from typing import List
class Solution:
def longestEqualSubarray(self, nums: List[int], k: int) -> int:
value_to_indices = defaultdict(list)
for idx, num in enumerate(nums):
value_to_indices[num].append(idx)
max_len = 0
for v in value... | true | null | 69,688 | 2,140 |
2834 | 13,750 | false | ok | from collections import defaultdict
from typing import List
class Solution:
def relocateMarbles(self, nums: List[int], moveFrom: List[int], moveTo: List[int]) -> List[int]:
count = defaultdict(int)
for num in nums:
count[num] += 1
for from_pos, to_pos in zip(moveFrom, moveTo):
... | true | null | 47,561 | 1,762 |
2839 | 16,566 | false | ok | from typing import List
class Solution:
def maximumSumQueries(self, nums1: List[int], nums2: List[int], queries: List[List[int]]) -> List[int]:
pairs = []
n = len(nums1)
for j in range(n):
a = nums1[j]
b = nums2[j]
sum_ab = a + b
pairs.append(... | true | null | 63,088 | 1,609 |
2845 | 26,849 | false | ok | from typing import List
class Solution:
def findValueOfPartition(self, nums: List[int]) -> int:
nums_sorted = sorted(nums)
n = len(nums_sorted)
min_value = float('inf')
for i in range(n):
bi = nums_sorted[i]
# Find the first element > bi after position i
... | false | null | 90,292 | 2,095 |
2848 | 19,424 | false | ok | from typing import List
from collections import defaultdict
class Solution:
def specialPerm(self, nums: List[int]) -> int:
MOD = 10**9 + 7
n = len(nums)
current_dp = defaultdict(int)
# Initialize current_dp with all single-element permutations
for i in range(n):
... | true | null | 63,107 | 2,753 |
2850 | 24,798 | false | ok | class Solution:
def longestString(self, x: int, y: int, z: int) -> int:
a = min(x, y + z)
b = min(y, x + z)
return 2 * (a + b + z) | false | null | 88,009 | 1,138 |
2855 | 16,103 | false | ok | from typing import List
class Solution:
def maximumJumps(self, nums: List[int], target: int) -> int:
n = len(nums)
dp = [-1] * n
dp[0] = 0 # base case: 0 jumps to reach start
for i in range(1, n):
max_jumps = -1
for j in range(i):
if dp[j] !... | true | null | 42,314 | 1,760 |
2857 | 20,440 | false | ok | class Solution:
def distanceTraveled(self, mainTank: int, additionalTank: int) -> int:
x = min(additionalTank, (mainTank - 1) // 4)
remaining = max(mainTank - 4 * x, 0)
return 50 * x + 10 * remaining | true | null | 63,957 | 1,656 |
2867 | 21,113 | false | ok | from typing import List
class Solution:
def numberOfGoodSubarraySplits(self, nums: List[int]) -> int:
MOD = 10**9 + 7
ones_indices = []
for i, num in enumerate(nums):
if num == 1:
ones_indices.append(i)
if not ones_indices:
return 0
i... | true | null | 71,405 | 1,468 |
2869 | 19,739 | false | ok | from typing import List
class Solution:
def maxNonDecreasingLength(self, nums1: List[int], nums2: List[int]) -> int:
n = len(nums1)
if n == 0:
return 0
len1_prev = 1
len2_prev = 1
max_length = 1
for i in range(1, n):
# Compute len1_current
... | true | null | 61,600 | 2,283 |
2872 | 25,675 | false | ok | from typing import List
class Solution:
def maxArrayValue(self, nums: List[int]) -> int:
while len(nums) > 1:
max_i = -1
n = len(nums)
# Iterate from the end to find the largest i where nums[i] <= nums[i+1]
for j in range(n - 2, -1, -1):
if nu... | true | null | 93,004 | 1,650 |
2876 | 6,148 | false | ok | from typing import List
class Solution:
def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:
return sum(1 for h in hours if h >= target) | true | null | 25,286 | 1,249 |
2878 | 26,155 | false | ok | from typing import List
class Solution:
def checkArray(self, nums: List[int], k: int) -> bool:
n = len(nums)
if k > n:
return False
m = n - k + 1
if m <= 0:
return True
x = [0] * m
prefix = [0] * m
for i in range(m):
if i <... | true | null | 81,116 | 2,265 |
2881 | 11,733 | false | ok | from typing import List
class Solution:
def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:
return [part for word in words for part in word.split(separator) if part] | true | null | 48,306 | 1,522 |
2883 | 24,166 | false | ok | class Solution:
def minimumBeautifulSubstrings(self, s: str) -> int:
n = len(s)
beautiful = {
1: "1",
3: "101",
5: "11001",
7: "1111101",
10: "1001110001",
13: "110000010101"
}
dp = [float('inf')] * (n + 1)
... | true | null | 75,586 | 1,811 |
2886 | 10,773 | false | ok | class Solution:
def finalString(self, s: str) -> str:
result = []
for char in s:
if char == 'i':
result.reverse()
else:
result.append(char)
return ''.join(result) | true | null | 34,318 | 1,131 |
2888 | 18,885 | false | ok | from collections import defaultdict
from typing import List
class Solution:
def minimumIndex(self, nums: List[int]) -> int:
n = len(nums)
if n < 2:
return -1
# Step 1: Find the dominant element and its count
freq = defaultdict(int)
for num in nums:
f... | true | null | 64,814 | 1,926 |
2892 | 18,610 | false | ok | from typing import List
class Solution:
def isGood(self, nums: List[int]) -> bool:
if not nums:
return False
n = max(nums)
if len(nums) != n + 1:
return False
base = list(range(1, n)) + [n, n]
nums_sorted = sorted(nums)
return nums_sorted =... | true | null | 58,927 | 1,605 |
2902 | 18,296 | false | ok | from typing import List
class Solution:
def maxSum(self, nums: List[int]) -> int:
def get_max_digit(num):
max_digit = 0
for digit in str(num):
current_digit = int(digit)
if current_digit > max_digit:
max_digit = current_digit
... | true | null | 66,966 | 2,581 |
2916 | 17,809 | false | ok | from functools import lru_cache
from typing import List
class Solution:
def canSplitArray(self, nums: List[int], m: int) -> bool:
n = len(nums)
if n == 1:
return True
prefix = [0] * (n + 1)
for i in range(n):
prefix[i+1] = prefix[i] + nums[i]
def ge... | true | null | 65,949 | 2,495 |
2919 | 30,332 | false | ok | from typing import List
class Solution:
def maxIncreasingGroups(self, usageLimits: List[int]) -> int:
n = len(usageLimits)
if n == 0:
return 0
total = sum(usageLimits)
# Binary search bounds
low = 1
high = min(n, int((2 * total) ** 0.5) + 2)
answ... | false | null | 111,979 | 2,331 |
2921 | 26,900 | false | ok | class Solution:
def countSteppingNumbers(self, low: str, high: str) -> int:
MOD = 10**9 + 7
def decrement(s):
if not s or s == '0':
return '0'
s = list(s)
n = len(s)
for i in range(n-1, -1, -1):
if s[i] != '0':
... | true | null | 95,404 | 5,224 |
2953 | 15,416 | false | ok | from collections import defaultdict
from typing import List
class Solution:
def countPairs(self, coordinates: List[List[int]], k: int) -> int:
freq = defaultdict(int)
result = 0
for point in coordinates:
x, y = point
for a in range(0, k + 1):
b = k -... | true | null | 46,839 | 1,974 |
2955 | 10,816 | false | ok | class Solution:
def accountBalanceAfterPurchase(self, purchaseAmount: int) -> int:
return 100 - ((purchaseAmount + 5) // 10) * 10 | true | null | 33,834 | 787 |
2979 | 25,667 | false | ok | from typing import List
class Solution:
def maximizeTheProfit(self, n: int, offers: List[List[int]]) -> int:
if not offers:
return 0
# Sort offers by end time
offers_sorted = sorted(offers, key=lambda x: x[1])
m = len(offers_sorted)
dp = [0] * m
max_dp_pr... | true | null | 89,923 | 3,449 |
2999 | 14,321 | false | ok | class Solution:
def canBeEqual(self, s1: str, s2: str) -> bool:
return {s1[0], s1[2]} == {s2[0], s2[2]} and {s1[1], s1[3]} == {s2[1], s2[3]} | true | null | 43,241 | 1,272 |
3017 | 26,405 | false | ok | from functools import lru_cache
class Solution:
def numberOfBeautifulIntegers(self, low: int, high: int, k: int) -> int:
def count_up_to(N):
if N < 1:
return 0
s = str(N)
n = len(s)
@lru_cache(maxsize=None)
def dp(pos, tight, even... | false | null | 94,456 | 2,261 |
3024 | 32,768 | true | ok | null | null | null | null | null |
3026 | 28,129 | false | ok | MOD = 10**9 + 7
def minimumPossibleSum(n: int, target: int) -> int:
m = target // 2
if n <= m:
return (n * (n + 1) // 2) % MOD
else:
if m == 0:
S1 = 0
else:
S1 = (m * (m + 1) // 2) % MOD
k = n - m
part1 = (k * target) % MOD
if k <= 1:
... | true | null | 83,003 | 1,887 |
3032 | 22,620 | false | ok | from typing import List
class Solution:
def getMaxFunctionValue(self, receiver: List[int], k: int) -> int:
n = len(receiver)
max_f = 0
for x in range(n):
sequence = []
node_to_index = {} # maps node to first occurrence index
current = x
inde... | true | null | 82,893 | 2,946 |
3034 | 24,433 | false | ok | from typing import List
class Solution:
def numberOfPoints(self, nums: List[List[int]]) -> int:
if not nums:
return 0
nums.sort()
merged = [nums[0]]
for interval in nums[1:]:
last_start, last_end = merged[-1]
current_start, current_end = interval... | true | null | 89,101 | 1,974 |
3045 | 23,972 | false | ok | from typing import List
class Solution:
def minimumRightShifts(self, nums: List[int]) -> int:
n = len(nums)
if n == 0:
return -1
sorted_nums = sorted(nums)
concatenated = nums + nums
for i in range(n):
if concatenated[i:i+n] == sorted_nums:
... | true | null | 82,635 | 1,972 |
3047 | 28,194 | false | ok | from collections import defaultdict
from typing import List
def square_free_part(k):
if k == 0:
return 0
square_free = 1
temp = k
# Handle 2 separately
if temp % 2 == 0:
exponent = 0
while temp % 2 == 0:
exponent += 1
temp //= 2
if exponent % ... | false | null | 101,105 | 2,136 |
3080 | 29,653 | false | ok | from typing import List
class Solution:
def maxSubarrays(self, nums: List[int]) -> int:
n = len(nums)
if n == 0:
return 0
# Compute the entire AND
total_and = nums[0]
for num in nums[1:]:
total_and &= num
if total_and != 0:
return... | false | null | 109,792 | 2,228 |
3091 | 30,838 | false | ok | from collections import defaultdict
from typing import List
MOD = 10**9 + 7
class Solution:
def countSubMultisets(self, nums: List[int], l: int, r: int) -> int:
freq = defaultdict(int)
for num in nums:
freq[num] += 1
max_sum = r
dp = [0] * (max_sum + 1)
dp[0] =... | true | null | 91,680 | 3,153 |
3094 | 20,134 | false | ok | from collections import defaultdict
class Solution:
def minOperations(self, nums: List[int]) -> int:
freq = defaultdict(int)
for num in nums:
freq[num] += 1
for count in freq.values():
if count == 1:
return -1
total_ops = 0
for count... | true | null | 63,292 | 1,545 |
3106 | 19,135 | false | ok | from typing import List
class Solution:
def lengthOfLongestSubsequence(self, nums: List[int], target: int) -> int:
dp = {0: 0} # sum: length
for num in nums:
new_dp = dict(dp) # copy all previous sums (not taking current num)
for s in dp:
new_sum = s + num... | true | null | 58,048 | 2,205 |
3141 | 30,558 | false | ok | from typing import List
class Solution:
def minSizeSubarray(self, nums: List[int], target: int) -> int:
n = len(nums)
if n == 0:
return -1
# Compute prefix sums
prefix = [0] * (n + 1)
for i in range(1, n + 1):
prefix[i] = prefix[i-1] + nums[i-1]
... | true | null | 104,463 | 2,707 |
3151 | 18,148 | false | ok | from typing import List
class Solution:
def minProcessingTime(self, processorTime: List[int], tasks: List[int]) -> int:
processorTime.sort()
tasks.sort(reverse=True)
max_time = 0
num_processors = len(processorTime)
for i in range(num_processors):
current_max_tas... | true | null | 57,997 | 1,984 |
3163 | 11,609 | false | ok | from typing import List
class Solution:
def sumCounts(self, nums: List[int]) -> int:
total = 0
n = len(nums)
for i in range(n):
S = set()
for j in range(i, n):
S.add(nums[j])
count = len(S)
total += count * count
... | true | null | 41,657 | 1,430 |
3166 | 25,048 | false | ok | from typing import List
from collections import defaultdict
class Solution:
def minGroupsForValidAssignment(self, nums: List[int]) -> int:
freq = defaultdict(int)
n = len(nums)
for num in nums:
freq[num] += 1
frequencies = list(freq.values())
def isFeasible(k):
... | false | null | 85,332 | 3,160 |
3172 | 9,822 | false | ok | class Solution:
def differenceOfSums(self, n: int, m: int) -> int:
total_sum = n * (n + 1) // 2
k = n // m
divisible_sum = m * k * (k + 1) // 2
return total_sum - 2 * divisible_sum | true | null | 24,610 | 1,448 |
3176 | 21,308 | false | ok | from typing import List
class Solution:
def minimumSum(self, nums: List[int]) -> int:
n = len(nums)
min_sum = float('inf')
for j in range(1, n-1):
# Find min_left
min_left = None
for i in range(j):
if nums[i] < nums[j]:
... | true | null | 73,265 | 1,902 |
3184 | 29,067 | false | ok | import bisect
from typing import List
class SegmentTree:
def __init__(self, size):
self.size = size
self.tree = [float('-inf')] * (2 * size)
def update(self, index, value):
index += self.size
self.tree[index] = value
index >>= 1
while index >= 1:
new... | true | null | 106,745 | 3,406 |
3190 | 14,695 | false | ok | from typing import List
class Solution:
def minOperations(self, nums1: List[int], nums2: List[int]) -> int:
n = len(nums1)
if n == 0:
return -1
a = nums1[n-1]
b = nums2[n-1]
# Case 1: No swap at n-1
case1_possible = True
case1_swaps = 0
f... | true | null | 45,573 | 2,270 |
3193 | 22,572 | false | ok | from typing import List
class Solution:
def maximumStrongPairXor(self, nums: List[int]) -> int:
nums_sorted = sorted(nums)
n = len(nums_sorted)
max_xor = 0
for i in range(n):
x = nums_sorted[i]
for j in range(i, n):
y = nums_sorted[j]
... | true | null | 70,291 | 2,115 |
3195 | 29,353 | false | ok | class Solution:
def minimumSteps(self, s: str) -> int:
total_zeros = s.count('0')
count_so_far = 0
total_swaps = 0
for char in s:
if char == '0':
count_so_far += 1
else: # char == '1'
total_swaps += total_zeros - count_so_far
... | true | null | 109,012 | 1,494 |
3200 | 28,476 | false | ok | MOD = 10**9 + 7
class Solution:
def stringCount(self, n: int) -> int:
if n < 4:
return 0
def pow_mod(a, b, mod):
result = 1
a = a % mod
while b > 0:
if b % 2 == 1:
result = (result * a) % mod
a = (a... | true | null | 70,783 | 2,565 |
3206 | 10,554 | false | ok | from typing import List
class Solution:
def findIntersectionValues(self, nums1: List[int], nums2: List[int]) -> List[int]:
set2 = set(nums2)
count1 = sum(1 for num in nums1 if num in set2)
set1 = set(nums1)
count2 = sum(1 for num in nums2 if num in set1)
return [count1, co... | true | null | 37,977 | 1,330 |
3209 | 27,479 | false | ok | from typing import List
class Solution:
def minimumCoins(self, prices: List[int]) -> int:
n = len(prices)
dp = [0] * (n + 1) # dp[0] = 0, dp[i] is for first i fruits (1-based)
dp[0] = 0
for i in range(1, n + 1):
min_cost = float('inf')
lower = max(1, (i + 1)... | true | null | 81,492 | 1,841 |
3211 | 24,908 | false | ok | from typing import List
class Solution:
def findMaximumLength(self, nums: List[int]) -> int:
n = len(nums)
if n == 0:
return 0
max_blocks = 1 # at least one block (the whole array)
# Iterate over all possible subsets of split points
for mask in range(1 << (n-1)... | false | null | 94,144 | 2,651 |
3213 | 23,434 | false | ok | from typing import List
class Solution:
def countSubarrays(self, nums: List[int], k: int) -> int:
if not nums:
return 0
max_num = max(nums)
n = len(nums)
b = [1 if num == max_num else 0 for num in nums]
prefix = [0] * (n + 1)
for i in range(1, n+1):
... | true | null | 80,165 | 2,284 |
3220 | 18,547 | false | ok | from typing import List
class Solution:
def countTestedDevices(self, batteryPercentages: List[int]) -> int:
count = 0
for j in range(len(batteryPercentages)):
effective_battery = max(0, batteryPercentages[j] - count)
if effective_battery > 0:
count += 1
... | true | null | 54,215 | 1,569 |
3223 | 26,352 | false | ok | from collections import defaultdict
class Solution:
def countCompleteSubstrings(self, word: str, k: int) -> int:
n = len(word)
count = 0
max_t = n // k
for t in range(1, max_t + 1):
L = t * k
if L > n:
continue
for i in range(n - ... | false | null | 92,686 | 2,259 |
3225 | 18,680 | false | ok | from collections import defaultdict
from typing import List
class Solution:
def maxSubarrayLength(self, nums: List[int], k: int) -> int:
n = len(nums)
left = 0
max_len = 0
freq = defaultdict(int)
for right in range(n):
freq[nums[right]] += 1
while f... | true | null | 59,169 | 2,122 |
3227 | 24,050 | false | ok | from typing import List
class Solution:
def findMissingAndRepeatedValues(self, grid: List[List[int]]) -> List[int]:
n = len(grid)
total_numbers = n * n
S = total_numbers * (total_numbers + 1) // 2
S2 = total_numbers * (total_numbers + 1) * (2 * total_numbers + 1) // 6
sum_g... | true | null | 82,255 | 1,830 |
3229 | 27,058 | false | ok | import bisect
class Solution:
def minimumCost(self, nums: List[int]) -> int:
if not nums:
return 0
L = min(nums)
R = max(nums)
sorted_nums = sorted(nums)
n = len(sorted_nums)
prefix = [0] * (n + 1)
for i in range(n):
prefix[i+1] = pref... | true | null | 89,224 | 4,235 |
3231 | 17,492 | false | ok | from typing import List
class Solution:
def minimumAddedCoins(self, coins: List[int], target: int) -> int:
coins.sort()
max_reachable = 0
added_coins = 0
i = 0
n = len(coins)
while max_reachable < target:
if i < n and coins[i] <= max_reachable + 1:
... | true | null | 55,125 | 1,852 |
3234 | 10,556 | false | ok | from typing import List
class Solution:
def getGoodIndices(self, variables: List[List[int]], target: int) -> List[int]:
result = []
for i, var in enumerate(variables):
a, b, c, m = var
temp1 = pow(a % 10, b, 10)
temp2 = pow(temp1, c, m)
if temp2 == ta... | true | null | 28,260 | 1,476 |
3236 | 22,680 | false | ok | from typing import List
class Solution:
def missingInteger(self, nums: List[int]) -> int:
# Find the length of the longest sequential prefix
length = 1
for i in range(1, len(nums)):
if nums[i] == nums[i-1] + 1:
length += 1
else:
break
... | true | null | 65,958 | 2,323 |
3242 | 15,891 | false | ok | from typing import List
from collections import Counter
class Solution:
def maxFrequencyElements(self, nums: List[int]) -> int:
freq = Counter(nums)
m = max(freq.values())
return sum(v for v in freq.values() if v == m) | true | null | 60,779 | 1,895 |
3245 | 19,237 | false | ok | from bisect import bisect_left
from typing import List
class Solution:
def beautifulIndices(self, s: str, a: str, b: str, k: int) -> List[int]:
len_s = len(s)
len_a = len(a)
len_b = len(b)
a_indices = []
for i in range(len_s - len_a + 1):
if s[i:i+len_a] == a:
... | true | null | 62,609 | 2,128 |
3249 | 20,783 | false | ok | from typing import List
class Solution:
def minOperations(self, nums: List[int], k: int) -> int:
current_xor = 0
for num in nums:
current_xor ^= num
diff = current_xor ^ k
count = 0
while diff:
diff &= diff - 1
count += 1
return co... | true | null | 75,909 | 1,716 |
3252 | 23,939 | false | ok | from typing import List
class Solution:
def incremovableSubarrayCount(self, nums: List[int]) -> int:
n = len(nums)
if n == 0:
return 0
# Compute prefix_ok[l] = whether nums[0..l-1] is strictly increasing
prefix_ok = [True] * (n + 1)
for l in range(1, n + 1):
... | true | null | 80,202 | 2,323 |
3262 | 25,892 | false | ok | from typing import List
class Solution:
def largestPerimeter(self, nums: List[int]) -> int:
nums.sort(reverse=True)
n = len(nums)
if n < 3:
return -1
# Compute suffix sums
suffix_sum = [0] * (n + 1)
for i in range(n-1, -1, -1):
suffix_sum[i] ... | true | null | 90,068 | 2,156 |
3264 | 24,498 | false | ok | from typing import List
class Solution:
def maximumPoints(self, enemyEnergies: List[int], currentEnergy: int) -> int:
indexed_enemies = [(energy, i) for i, energy in enumerate(enemyEnergies)]
indexed_enemies.sort()
sorted_enemies = [energy for energy, idx in indexed_enemies]
origina... | false | null | 93,860 | 3,555 |
3267 | 22,503 | false | ok | from collections import defaultdict
class Solution:
def maximumLength(self, s: str) -> int:
n = len(s)
if n < 3:
return -1
runs = []
if n > 0:
current_char = s[0]
current_length = 1
for i in range(1, n):
if s[i] == cur... | true | null | 80,267 | 2,182 |
3279 | 16,779 | false | ok | class Solution:
def flowerGame(self, n: int, m: int) -> int:
a = (n + 1) // 2
b = n // 2
c = (m + 1) // 2
d = m // 2
return a * d + b * c | true | null | 54,945 | 1,048 |
3292 | 29,926 | false | ok | from typing import List
from collections import defaultdict
from itertools import product
class Solution:
def earliestSecondToMarkIndices(self, nums: List[int], changeIndices: List[int]) -> int:
n = len(nums)
m = len(changeIndices)
# Check if all indices from 1 to n are present in changeInd... | false | null | 115,874 | 3,335 |
3298 | 25,812 | false | ok | from typing import List
class Solution:
def maxSelectedElements(self, nums: List[int]) -> int:
if not nums:
return 0
nums_sorted = sorted(nums)
n = len(nums_sorted)
min_num = min(nums_sorted)
max_num = max(nums_sorted)
for m in range(n, 0, -1):
... | false | null | 91,106 | 2,355 |
3306 | 20,066 | false | ok | from typing import List
class Solution:
def unmarkedSumArray(self, nums: List[int], queries: List[List[int]]) -> List[int]:
n = len(nums)
sorted_elements = sorted([(nums[i], i) for i in range(n)])
marked = set()
current_sum = sum(nums)
answer = []
for index_i, k_i i... | false | null | 75,699 | 2,341 |
3309 | 28,059 | false | ok | from typing import List
from collections import defaultdict
class Solution:
def countPrefixSuffixPairs(self, words: List[str]) -> int:
count = 0
freq = defaultdict(int)
for j in range(len(words)):
current_word = words[j]
S = set()
m = len(current_word)
... | true | null | 98,362 | 1,648 |
3312 | 16,443 | false | ok | class Solution:
def countKeyChanges(self, s: str) -> int:
if len(s) <= 1:
return 0
count = 0
prev_char = s[0].lower()
for char in s[1:]:
current_char = char.lower()
if current_char != prev_char:
count += 1
prev_char = cu... | true | null | 56,083 | 1,526 |
3316 | 24,240 | false | ok | from itertools import combinations
from typing import List
class Solution:
def sumOfPowers(self, nums: List[int], k: int) -> int:
MOD = 10**9 + 7
n = len(nums)
total = 0
for indices in combinations(range(n), k):
subsequence = [nums[i] for i in indices]
sorte... | false | null | 102,587 | 1,798 |
3324 | 25,066 | false | ok | from collections import defaultdict
from typing import List
class Solution:
def isPossibleToSplit(self, nums: List[int]) -> bool:
freq = defaultdict(int)
for num in nums:
freq[num] += 1
for count in freq.values():
if count > 2:
return False
re... | true | null | 77,101 | 1,384 |
3328 | 27,979 | false | ok | import math
class Solution:
def minOperations(self, k: int) -> int:
sqrt_k = math.sqrt(k)
lower_m = max(1, int(sqrt_k) - 10)
upper_m = int(sqrt_k) + 10
min_ops = float('inf')
for m in range(lower_m, upper_m + 1):
x = (k + m - 1) // m
current_ops = x +... | true | null | 79,450 | 1,548 |
3331 | 24,621 | false | ok | from typing import List
class Solution:
def minOperations(self, nums: List[int], k: int) -> int:
return sum(1 for num in nums if num < k) | true | null | 72,741 | 1,104 |
3337 | 20,267 | false | ok | class Solution:
def countSubstrings(self, s: str, c: str) -> int:
count = 0
for char in s:
if char == c:
count += 1
return count * (count + 1) // 2 | true | null | 61,464 | 1,376 |
3345 | 22,253 | false | ok | from typing import List
class Solution:
def sumOfPower(self, nums: List[int], k: int) -> int:
n = len(nums)
total = 0
MOD = 10**9 + 7
for mask in range(1 << n):
S = []
for i in range(n):
if mask & (1 << i):
S.append(nums[i... | false | null | 75,004 | 1,922 |
3347 | 9,753 | false | ok | from typing import List
class Solution:
def resultArray(self, nums: List[int]) -> List[int]:
arr1 = [nums[0]]
arr2 = [nums[1]]
for num in nums[2:]:
if arr1[-1] > arr2[-1]:
arr1.append(num)
else:
arr2.append(num)
return arr1 +... | true | null | 29,778 | 1,277 |
3351 | 22,883 | false | ok | from typing import List
class Solution:
def maximumHappinessSum(self, happiness: List[int], k: int) -> int:
happiness_sorted = sorted(happiness, reverse=True)
total = 0
for i in range(k):
contribution = max(happiness_sorted[i] - i, 0)
total += contribution
re... | true | null | 76,666 | 1,649 |
3355 | 22,399 | false | ok | from typing import List
class Solution:
def minimumLevels(self, possible: List[int]) -> int:
levels = [1 if p == 1 else -1 for p in possible]
S = sum(levels)
current_sum = 0
for k in range(1, len(possible)):
current_sum += levels[k-1]
if 2 * current_sum > S:
... | true | null | 66,116 | 1,338 |
uq-magistral — reasoning traces, labels and per-token statistics for Magistral-Small
Companion to loose-bits/uq-hiddenstates,
adding a fourth model family (Mistral) to the same five-benchmark suite. Everything here
was produced by the same pipeline; the layout differs only where Magistral forced it to.
Model: mistralai/Magistral-Small-2507 — 40 decoder blocks, hidden size 5120, vocab
131072. Its thinking block is delimited by the single tokens [THINK] (34) and [/THINK]
(35), and its tokenizer ships no chat template, so the prompt is built by hand (the
format is on the model card; our implementation is artifact/src/uspace/chat.py in the
project repo).
Generation: 1000 items per benchmark, temperature 0.7, top-p 0.95, seed 42, token budget 32768, thinking enabled.
| benchmark | accuracy | graded | truncation rate |
|---|---|---|---|
| LiveCodeBench | 63.8% | 974 | 2.6% |
| MMLU-Pro | 75.7% | 974 | 1.5% |
| Omni-MATH | 59.2% | 928 | 7.2% |
| SuperGPQA | 44.6% | 977 | 2.0% |
| TriviaQA | 78.0% | 946 | 5.0% |
Ungraded items are truncated generations or unparseable answers; they carry correct: null
and every consumer here skips them rather than scoring them as wrong.
Layout
traces/magistral_{ds}.jsonl.gz one record per item: id, ds, prompt_ids, gen_ids,
tlen, finish, seed (+ .meta.json per file)
labels/magistral_{ds}.jsonl id, correct, pred, flag, stage, tlen, truncated,
think_chars, ans_chars
logits/magistral_{ds}_logits.npz per-token statistics over the generation, ragged and
concatenated (see below)
caches/eot_states_magistral.npz end-of-think hidden state per item, block 29
caches/score_cache_magistral.npz per-scorer arrays aligned to the eot cache
positions/magistral_{ds}_positions.jsonl pre-answer and end-of-think token indices
Extracting hidden states at other depths yourself
traces/ carries prompt_ids and gen_ids, so any block can be captured by replaying a
trace teacher-forced. Two things to know before spending the GPU time:
The Magistral J-lens covers 7 blocks, not 40: [22, 25, 26, 29, 31, 33, 37]. No lens is
published for the Mistral family; this one was fitted for this project at those depths. So an
all-block capture is ~85% unusable. Those seven span relative depth 0.575–0.950 and include
block 29 (the readout used here) and block 25 — which is what a label-free
category-silhouette rule selects on this model.
positions/ is a prerequisite, not a convenience. The pass-1 capture script skips any
dataset whose positions file is missing rather than failing, so a run without them returns an
npz that looks valid and is short. TriviaQA's is absent here: it needs an answer-span file
built by the Orgad et al. procedure, which is being generated and will be added.
Tokenizer. Loading this checkpoint through AutoTokenizer warns of an incorrect regex
pattern and asks for fix_mistral_regex=True. The traces here are unaffected (generated
under vLLM) and the positions work decodes saved ids, so the encode path never runs — but
anything that re-tokenizes text needs that flag, and the failure mode is silent
token-index drift against the ids in this dataset.
The logits npz
Ragged arrays concatenated across items; off[i] and n[i] give item i's slice.
tok_logprob,tok_entropy,tok_logprob_sum— per generated tokentopk_logprob— top-20 log-probs per token (topk = 20)item_id,y(1 = incorrect),prompt_len,pre_tok,eot_tokeot_state—[1000, 5120]float32, the residual stream at the end-of-think markerhidden_block = 29, i.e. relative depth 0.75 —rel = (block + 1) / 40
import numpy as np
z = np.load("logits/magistral_mmlupro_logits.npz", allow_pickle=True)
i = 0
sl = slice(int(z["off"][i]), int(z["off"][i]) + int(z["n"][i]))
ent = z["tok_entropy"][sl] # per-token entropy for item 0
h = z["eot_state"][i] # its end-of-think state, block 29
Two caveats worth reading before you use this
The readout depth is block 29 and only block 29. eot_state is captured at relative
depth 0.75 to match the other three models in the companion dataset. There are no all-block
states here, so a readout-depth sweep is not possible from this dataset alone — it needs a
fresh capture.
Magistral's anchor cone is degenerate at this depth. Using the published U-Space
construction, A_cone = ||ReLU(Uᵀ ν(h))|| is exactly zero on 100% of LiveCodeBench
items, 62% of Omni-MATH and 39% of SuperGPQA: every anchor projection is non-positive, the
ReLU clips the whole cone, and the resulting AUROC is the AUROC of a constant. The mean
projection is ≈ −0.02 here against ≈ ±0.0001 on Gemma — an anisotropic residual stream whose
dominant direction all four transported anchor directions oppose. Mean-centring the states
before normalising removes it (LiveCodeBench 0.501 → 0.680 length-matched) but costs Gemma
and Qwen 0.04–0.05, so it is a repair for one failure mode rather than a better method.
If you are evaluating a signed axis rather than a hinged one, this is the interesting model in the suite: a signed score has no such floor, so Magistral is where the two constructions should differ most.
Provenance
Generated, graded and captured 2026-09-16 as part of an ICLR 2027 submission on reading uncertainty from the residual stream. Benchmark questions belong to their original authors under their own licences; what is released here is the model's outputs and statistics derived from them.
- Downloads last month
- 50