Datasets:
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
Error code: DatasetGenerationError
Exception: TypeError
Message: Couldn't cast array of type int64 to null
Traceback: Traceback (most recent call last):
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1835, in _prepare_split_single
for key, table in generator:
^^^^^^^^^
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 621, in wrapped
for item in generator(*args, **kwargs):
~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 361, 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 2381, in table_cast
return cast_table_to_schema(table, schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2315, in cast_table_to_schema
cast_array_to_feature(
~~~~~~~~~~~~~~~~~~~~~^
table[name] if name in table_column_names else pa.array([None] * len(table), type=schema.field(name).type),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
feature,
^^^^^^^^
)
^
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1861, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2155, in cast_array_to_feature
return array_cast(
array,
...<2 lines>...
allow_decimal_to_str=allow_decimal_to_str,
)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1863, in wrapper
return func(array, *args, **kwargs)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2014, in array_cast
raise TypeError(f"Couldn't cast array of type {_short_str(array.type)} to {_short_str(pa_type)}")
TypeError: Couldn't cast array of type int64 to null
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 1379, 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 956, 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 1702, 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 1887, 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.
prompt_id string | domain string | prompt string | gold string | source_id string | meta unknown | text string | output_token_ids list | n_tokens int64 | finish_reason string | stop_reason null | seed int64 | temperature float64 | top_p float64 | top_k int64 | repetition_penalty float64 | stop_token_ids list | max_new_tokens int64 | budget_exhausted bool | prompt_tokens int64 | engine_max_model_len int64 | model string | model_revision string |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
code_cf_1017_A | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: The Rank
John Smith knows that his son, Thomas Smith, is among the best students in his class and even in his school. After the students of the school took the e... | null | 1017/A | {
"rating": 800,
"tags": [
"implementation"
],
"contest_id": "1017",
"index": "A",
"contest_start_year": 2018,
"n_official_tests": 8,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
def find_rank(n, students):
"""
Find the rank of Thomas Smith.
Args:
n (int): The number of students.
students (list): A list of lists, where each sublist contains four scores.
Returns:
int: The rank of Thomas Smith.
"""
# Sort the students based on the sum of... | [
74694,
12958,
198,
755,
1505,
21048,
1471,
11,
4236,
997,
262,
3270,
262,
7531,
279,
7222,
315,
11355,
9259,
382,
262,
18161,
512,
286,
308,
320,
396,
1680,
578,
1396,
315,
4236,
627,
286,
4236,
320,
1638,
1680,
362,
1160,
315,
11725,... | 350 | stop | null | 827,516,126 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 672 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1033_A | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: King Escape
Alice and Bob are playing chess on a huge chessboard with dimensions $$$n \times n$$$. Alice has a single piece leftΒ β a queen, located at $$$(a_x, a... | null | 1033/A | {
"rating": 1000,
"tags": [
"dfs and similar",
"graphs",
"implementation"
],
"contest_id": "1033",
"index": "A",
"contest_start_year": 2018,
"n_official_tests": 42,
"official_tests_complete": true,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
def is_valid_move(a, b, c, d, e, f):
return ((a != b) or (a != e) or (b != f)) and (
(a != c) or (b != d) or (c != e) or (d != f)
)
def solve():
n = int(input())
x, y = [int(i) for i in input().split()]
z, w = [int(i) for i in input().split()]
e, f = [int(i) for i in input().... | [
74694,
12958,
198,
755,
374,
8501,
17572,
2948,
11,
293,
11,
272,
11,
294,
11,
384,
11,
282,
997,
262,
471,
1819,
64,
976,
293,
8,
477,
320,
64,
976,
384,
8,
477,
320,
65,
976,
282,
595,
323,
2456,
286,
320,
64,
976,
272,
8,
... | 300 | stop | null | 1,633,137,624 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 881 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1285_A | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Mezo Playing Zoma
Today, Mezo is playing a game. Zoma, a character in that game, is initially at position $$$x = 0$$$. Mezo starts sending $$$n$$$ commands to Zo... | null | 1285/A | {
"rating": 800,
"tags": [
"math"
],
"contest_id": "1285",
"index": "A",
"contest_start_year": 2020,
"n_official_tests": 6,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
def find_diff_positions(n, commands):
if n == 1:
if commands == 'L':
return 1
elif commands == 'R':
return 1
return 0
left = right = 0
result = 0
for command in commands:
diff = abs(left - right)
if command == 'L':
lef... | [
74694,
12958,
198,
755,
1505,
16229,
38319,
1471,
11,
11545,
997,
262,
422,
308,
624,
220,
16,
512,
286,
422,
11545,
624,
364,
43,
3730,
310,
471,
220,
16,
198,
286,
4508,
11545,
624,
364,
49,
3730,
310,
471,
220,
16,
198,
286,
47... | 148 | stop | null | 595,011,600 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 528 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1294_A | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Collecting Coins
Polycarp has three sisters: Alice, Barbara, and Cerene. They're collecting coins. Currently, Alice has $$$a$$$ coins, Barbara has $$$b$$$ coins ... | null | 1294/A | {
"rating": 800,
"tags": [
"math"
],
"contest_id": "1294",
"index": "A",
"contest_start_year": 2020,
"n_official_tests": 3,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 2,
"memory_limit": 256
} | ```python
import sys
def solve():
a, b, c, n = map(int, sys.stdin.readline().split())
n -= a + b + c
if a == b == c and n % 2 == 0:
if n <= a:
print("YES")
else:
print("NO")
else:
print("NO")
t = int(sys.stdin.readline())
for _ in range(t):
solve()
... | [
74694,
12958,
271,
475,
5826,
271,
755,
11886,
4019,
262,
264,
11,
293,
11,
272,
11,
308,
284,
2472,
1577,
11,
5826,
44284,
32900,
1020,
7105,
2455,
262,
308,
6110,
264,
489,
293,
489,
272,
198,
262,
422,
264,
624,
293,
624,
272,
... | 97 | stop | null | 1,212,918,015 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 567 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1312_A | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Two Regular Polygons
You are given two integers $$$n$$$ and $$$m$$$ ($$$m < n$$$). Consider a convex regular polygon of $$$n$$$ vertices. Recall that a regular p... | null | 1312/A | {
"rating": 800,
"tags": [
"geometry",
"greedy",
"math",
"number theory"
],
"contest_id": "1312",
"index": "A",
"contest_start_year": 2020,
"n_official_tests": 3,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
def is_valid(n, m):
"""
Check if it's possible to build another convex regular polygon with m vertices
such that its center coincides with the center of the initial polygon and each
of its vertices is some vertex of the initial polygon.
:param n: Number of vertices in the initial polygon... | [
74694,
12958,
271,
755,
374,
8501,
1471,
11,
296,
997,
262,
3270,
262,
4343,
422,
433,
596,
3284,
311,
1977,
2500,
67030,
5912,
30472,
449,
296,
17672,
198,
262,
1778,
430,
1202,
4219,
23828,
3422,
449,
279,
4219,
315,
279,
2926,
3047... | 172 | stop | null | 1,857,419,153 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 461 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1339_A | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Filling Diamonds
You have integer $$$n$$$. Calculate how many ways are there to fully cover belt-like area of $$$4n-2$$$ triangles with diamond shapes.
Diamond ... | null | 1339/A | {
"rating": 900,
"tags": [
"brute force",
"dp",
"implementation",
"math"
],
"contest_id": "1339",
"index": "A",
"contest_start_year": 2020,
"n_official_tests": 2,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
def calculate_ways(n):
# Define a dictionary to map the numbers of diamonds to their corresponding covering possibilities
covering_possibilities = {
1: 1, # 1 diamond with area of 1
2: 3, # 1 diamond with area of 2, 3 diamonds with area of 1, 1 diamond with area of 4
3: 7, ... | [
74694,
12958,
271,
755,
11294,
1704,
954,
1471,
997,
262,
674,
19127,
264,
11240,
311,
2472,
279,
5219,
315,
49151,
311,
872,
12435,
18702,
24525,
198,
262,
18702,
623,
3746,
13757,
284,
341,
286,
220,
16,
25,
220,
16,
11,
220,
674,
... | 437 | stop | null | 976,773,534 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 457 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1367_A | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Short Substrings
Alice guesses the strings that Bob made for her.
At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. ... | null | 1367/A | {
"rating": 800,
"tags": [
"implementation",
"strings"
],
"contest_id": "1367",
"index": "A",
"contest_start_year": 2020,
"n_official_tests": 8,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 2,
"memory_limit": 256
} | ```python
for _ in range(int(input())):
s = input()
for i in range(1, len(s)):
print(s[i:i+2], end='')
```
This Python program will generate the correct output when run. It reads the input string from stdin, iterates over the string from index 1 to the last index, and prints each substring of length 2 ... | [
74694,
12958,
198,
2000,
721,
304,
2134,
1577,
5498,
368,
10162,
262,
274,
284,
1988,
746,
262,
369,
602,
304,
2134,
7,
16,
11,
2479,
1161,
10162,
286,
1194,
1161,
1004,
15007,
10,
17,
1145,
842,
52527,
14196,
19884,
2028,
13325,
2068... | 102 | stop | null | 634,903,547 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 668 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_139_A | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Petr and Book
One Sunday Petr went to a bookshop and bought a new book on sports programming. The book had exactly n pages.
Petr decided to start reading it sta... | null | 139/A | {
"rating": 1000,
"tags": [
"implementation"
],
"contest_id": "139",
"index": "A",
"contest_start_year": 2011,
"n_official_tests": 49,
"official_tests_complete": true,
"has_checker": false,
"time_limit": 2,
"memory_limit": 256
} | ```python
def solve(n, days):
"""
Find the day of the week Petr will finish reading the book.
Parameters:
n (int): Number of pages in the book.
days (list): Number of pages Petr can read on each day of the week.
Returns:
int: The number of the day of the week Petr will finish reading the b... | [
74694,
12958,
198,
755,
11886,
1471,
11,
2919,
997,
262,
3270,
262,
7531,
279,
1938,
315,
279,
2046,
96876,
690,
6381,
5403,
279,
2363,
382,
262,
13831,
512,
262,
308,
320,
396,
1680,
5742,
315,
6959,
304,
279,
2363,
627,
262,
2919,
... | 356 | stop | null | 635,494,898 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 564 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1415_A | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Prison Break
There is a prison that can be represented as a rectangular matrix with $$$n$$$ rows and $$$m$$$ columns. Therefore, there are $$$n \cdot m$$$ prison... | null | 1415/A | {
"rating": 800,
"tags": [
"brute force",
"math"
],
"contest_id": "1415",
"index": "A",
"contest_start_year": 2020,
"n_official_tests": 1,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
def calculate_seconds(n, m, r, c):
# Calculate the minimum number of seconds
min_seconds = max(r - 1, 0) + max(c - 1, 0) + max(n - r - 1, 0) + max(m - c - 1, 0)
return min_seconds
def main():
# Read the number of test cases
t = int(input())
# Process each test case
for _ in ran... | [
74694,
12958,
271,
755,
11294,
35925,
1471,
11,
296,
11,
436,
11,
272,
997,
262,
674,
21157,
279,
8187,
1396,
315,
6622,
198,
262,
1332,
35925,
284,
1973,
2666,
482,
220,
16,
11,
220,
15,
8,
489,
1973,
1361,
482,
220,
16,
11,
220,... | 177 | stop | null | 1,414,548,932 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 561 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1525_B | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Permutation Sort
You are given a permutation $$$a$$$ consisting of $$$n$$$ numbers $$$1$$$, $$$2$$$, ..., $$$n$$$ (a permutation is an array in which each elemen... | null | 1525/B | {
"rating": 900,
"tags": [
"constructive algorithms",
"greedy"
],
"contest_id": "1525",
"index": "B",
"contest_start_year": 2021,
"n_official_tests": 2,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 2,
"memory_limit": 256
} | ```python
import sys
def read_int():
return int(input())
def read_ints():
return list(map(int, input().split()))
def solve():
n = read_int()
nums = read_ints()
pos = [0] * (n + 1)
for i, num in enumerate(nums):
pos[num] = i + 1
op_count = 0
for i in range(1, n):
if po... | [
74694,
12958,
271,
475,
5826,
271,
755,
1373,
4132,
4019,
262,
471,
528,
5498,
12647,
755,
1373,
4132,
82,
4019,
262,
471,
1160,
9325,
1577,
11,
1988,
1020,
7105,
51062,
755,
11886,
4019,
262,
308,
284,
1373,
4132,
746,
262,
10520,
28... | 137 | stop | null | 1,557,984,447 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 728 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1543_A | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Exciting Bets
Welcome to Rockport City!
It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet $$$a$$$ dolla... | null | 1543/A | {
"rating": 900,
"tags": [
"greedy",
"math",
"number theory"
],
"contest_id": "1543",
"index": "A",
"contest_start_year": 2021,
"n_official_tests": 1,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
import sys
# Read the number of test cases from the input
t = int(sys.stdin.readline())
for _ in range(t):
# Read two integers from the input
a, b = map(int, sys.stdin.readline().split())
# Calculate the maximum excitement the fans can get
max_excitement = max(a, b) - min(a, b)
max_exc... | [
74694,
12958,
271,
475,
5826,
271,
2,
4557,
279,
1396,
315,
1296,
5157,
505,
279,
1988,
198,
83,
284,
528,
18635,
44284,
32900,
12647,
2000,
721,
304,
2134,
1175,
997,
262,
674,
4557,
1403,
26864,
505,
279,
1988,
198,
262,
264,
11,
... | 187 | stop | null | 322,688,578 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 699 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1560_A | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Dislike of Threes
Polycarp doesn't like integers that are divisible by $$$3$$$ or end with the digit $$$3$$$ in their decimal representation. Integers that meet ... | null | 1560/A | {
"rating": 800,
"tags": [
"implementation"
],
"contest_id": "1560",
"index": "A",
"contest_start_year": 2021,
"n_official_tests": 27,
"official_tests_complete": true,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
k = int(input())
n = 1
count = 0
while True:
if n % 3 == 0 or n % 10 == 3:
continue
count += 1
if count == k - 1:
print(n)
break
n += 1
``` | [
74694,
12958,
271,
475,
5826,
198,
1379,
284,
5826,
44284,
32900,
271,
83,
284,
528,
5498,
2455,
2000,
721,
304,
2134,
1175,
997,
262,
597,
284,
528,
5498,
2455,
262,
308,
284,
220,
16,
198,
262,
1797,
284,
220,
15,
198,
262,
1418,
... | 96 | stop | null | 260,388,185 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 395 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1579_A | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Casimir's String Solitaire
Casimir has a string $$$s$$$ which consists of capital Latin letters 'A', 'B', and 'C' only. Each turn he can choose to do one of the ... | null | 1579/A | {
"rating": 800,
"tags": [
"math",
"strings"
],
"contest_id": "1579",
"index": "A",
"contest_start_year": 2021,
"n_official_tests": 1,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 2,
"memory_limit": 256
} | ```python
def solve(s):
for a in range(len(s)):
for b in range(len(s)):
c = len(s) - a - b
if a + b + c == 0:
return "YES"
return "NO"
def main():
count = int(input())
for _ in range(count):
s = input()
print(solve(s))
if __name__ == ... | [
74694,
12958,
271,
755,
11886,
1161,
997,
262,
369,
264,
304,
2134,
7046,
1161,
10162,
286,
369,
293,
304,
2134,
7046,
1161,
10162,
310,
272,
284,
2479,
1161,
8,
482,
264,
482,
293,
198,
310,
422,
264,
489,
293,
489,
272,
624,
220,
... | 95 | stop | null | 1,615,038,940 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 605 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1607_C | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Minimum Extraction
Yelisey has an array $$$a$$$ of $$$n$$$ integers.
If $$$a$$$ has length strictly greater than $$$1$$$, then Yelisei can apply an operation ca... | null | 1607/C | {
"rating": 1000,
"tags": [
"brute force",
"sortings"
],
"contest_id": "1607",
"index": "C",
"contest_start_year": 2021,
"n_official_tests": 1,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
import sys
def min_extraction(n, arr):
if n == 1:
return arr[0]
arr = sorted(arr)
res = arr[0]
for i in range(1, len(arr)):
res = max(res, arr[i])
arr[i] -= res
return res
t = int(input())
for _ in range(t):
n = int(input())
arr = list(map(int, input().s... | [
74694,
12958,
271,
475,
5826,
271,
755,
1332,
95942,
1471,
11,
2961,
997,
262,
422,
308,
624,
220,
16,
512,
286,
471,
2961,
58,
15,
933,
262,
2961,
284,
10839,
11179,
340,
262,
594,
284,
2961,
58,
15,
933,
262,
369,
602,
304,
2134... | 108 | stop | null | 862,922,399 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 1,010 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1637_B | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: MEX and Array
Let there be an array $$$b_1, b_2, \ldots, b_k$$$. Let there be a partition of this array into segments $$$[l_1; r_1], [l_2; r_2], \ldots, [l_c; r_... | null | 1637/B | {
"rating": 1100,
"tags": [
"brute force",
"dp",
"greedy",
"math"
],
"contest_id": "1637",
"index": "B",
"contest_start_year": 2022,
"n_official_tests": 13,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
import sys
t = int(input())
for _ in range(t):
n = int(input())
arr = list(map(int, input().split()))
total_sum = 0
for length in range(1, n + 1):
for start in range(n - length + 1):
sub_arr = arr[start:start + length]
mex_count = 0
for num in sub... | [
74694,
12958,
271,
475,
5826,
271,
83,
284,
528,
5498,
2455,
2000,
721,
304,
2134,
1175,
997,
262,
308,
284,
528,
5498,
2455,
262,
2961,
284,
1160,
9325,
1577,
11,
1988,
1020,
7105,
51062,
262,
2860,
10370,
284,
220,
15,
198,
262,
3... | 269 | stop | null | 928,747,822 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 1,121 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1658_B | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Marin and Anti-coprime Permutation
Marin wants you to count number of permutations that are beautiful. A beautiful permutation of length $$$n$$$ is a permutation... | null | 1658/B | {
"rating": 800,
"tags": [
"combinatorics",
"math",
"number theory"
],
"contest_id": "1658",
"index": "B",
"contest_start_year": 2022,
"n_official_tests": 1,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
from math import gcd
def permute_beautiful(n):
mod = 998244353
if n == 1:
return 1
elif n == 2:
return 2
dp = [0] * n
dp[0] = 1
for i in range(1, n):
dp[i] = (dp[i-1] * i) % mod
res = 0
for i in range(n):
if n % i == 0:
res = (... | [
74694,
12958,
271,
1527,
7033,
1179,
45958,
271,
755,
14175,
1088,
21960,
35777,
1471,
997,
262,
1491,
284,
220,
19416,
13719,
17228,
271,
262,
422,
308,
624,
220,
16,
512,
286,
471,
220,
16,
198,
262,
4508,
308,
624,
220,
17,
512,
... | 159 | stop | null | 1,243,948,253 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 534 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1674_B | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Dictionary
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combi... | null | 1674/B | {
"rating": 800,
"tags": [
"combinatorics",
"math"
],
"contest_id": "1674",
"index": "B",
"contest_start_year": 2022,
"n_official_tests": 1,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 2,
"memory_limit": 512
} | ```python
import sys
def solve():
s = input()
num = s[0] + s[1]
for i in range(1, 26):
if num == str(i) and s[0] != s[1]:
print(i + 1)
return
for i in range(1, 27):
if num == str(i) and s[0] == s[1]:
print(i + 1)
return
for i in range... | [
74694,
12958,
271,
475,
5826,
271,
755,
11886,
4019,
262,
274,
284,
1988,
746,
262,
1661,
284,
274,
58,
15,
60,
489,
274,
58,
16,
933,
262,
369,
602,
304,
2134,
7,
16,
11,
220,
1627,
997,
286,
422,
1661,
624,
610,
1998,
8,
323,
... | 243 | stop | null | 26,290,299 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 510 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1706_B | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Making Towers
You have a sequence of $$$n$$$ colored blocks. The color of the $$$i$$$-th block is $$$c_i$$$, an integer between $$$1$$$ and $$$n$$$.
You will pl... | null | 1706/B | {
"rating": 1100,
"tags": [
"dp",
"greedy",
"math"
],
"contest_id": "1706",
"index": "B",
"contest_start_year": 2022,
"n_official_tests": 2,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
import sys
def solve():
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
def check(s, c, mx):
if mx == 0:
return False
if s >= n:
return True
if mx[s] == c:
return True
return check(s + 1, c, mx[s])
... | [
74694,
12958,
271,
475,
5826,
271,
755,
11886,
4019,
262,
308,
284,
528,
5498,
2455,
262,
264,
284,
1160,
9325,
1577,
11,
1988,
1020,
7105,
51062,
262,
8261,
284,
510,
15,
60,
353,
308,
271,
262,
711,
1817,
1161,
11,
272,
11,
14961,... | 160 | stop | null | 1,175,477,196 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 1,107 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1732_B | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Ugu
A binary string is a string consisting only of the characters 0 and 1. You are given a binary string $$$s_1 s_2 \ldots s_n$$$. It is necessary to make this s... | null | 1732/B | {
"rating": 900,
"tags": [
"brute force",
"dp",
"greedy",
"implementation"
],
"contest_id": "1732",
"index": "B",
"contest_start_year": 2022,
"n_official_tests": 1,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
def is_non_decreasing(s, n):
"""Check if the given binary string is non-decreasing."""
for i in range(1, n):
if s[i] < s[i - 1]:
return False
return True
def min_operations(s, n):
"""Find the minimum number of operations required to make the string non-decreasing."""
... | [
74694,
12958,
271,
755,
374,
22368,
2310,
76562,
1161,
11,
308,
997,
262,
4304,
4061,
422,
279,
2728,
8026,
925,
374,
2536,
6953,
76562,
14781,
262,
369,
602,
304,
2134,
7,
16,
11,
308,
997,
286,
422,
274,
1004,
60,
366,
274,
1004,
... | 217 | stop | null | 1,123,163,970 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 704 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1818_B | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Indivisible
You're given a positive integer $$$n$$$.
Find a permutation $$$a_1, a_2, \dots, a_n$$$ such that for any $$$1 \leq l < r \leq n$$$, the sum $$$a_l +... | null | 1818/B | {
"rating": 900,
"tags": [
"constructive algorithms"
],
"contest_id": "1818",
"index": "B",
"contest_start_year": 2023,
"n_official_tests": 7,
"official_tests_complete": true,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
import sys
t = int(sys.stdin.readline().strip())
for _ in range(t):
n = int(sys.stdin.readline().strip())
if n == 1:
print(1)
elif n % 2 == 1:
print(-1)
else:
lst = list(range(1, n + 1))
idx = 0
res = []
while idx < len(lst):
if ... | [
74694,
12958,
271,
475,
5826,
271,
83,
284,
528,
18635,
44284,
32900,
1020,
13406,
12647,
2000,
721,
304,
2134,
1175,
997,
262,
308,
284,
528,
18635,
44284,
32900,
1020,
13406,
12647,
262,
422,
308,
624,
220,
16,
512,
286,
1194,
7,
16... | 172 | stop | null | 1,402,374,463 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 606 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1836_B | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Astrophysicists
In many, many years, far, far away, there will be a launch of the first flight to Mars. To celebrate the success, $$$n$$$ astrophysicists working... | null | 1836/B | {
"rating": 1100,
"tags": [
"greedy",
"math"
],
"contest_id": "1836",
"index": "B",
"contest_start_year": 2023,
"n_official_tests": 1,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
# Author: tigerrrt
# Date: 14 October 2026
def round_up(n, g):
"""Round up n to the nearest multiple of g"""
return n + (g - n % g)
def calculate_saved_amounts(n, k, g):
"""Calculate the amount of silver coins saved due to rounding"""
# Calculate the base silver coins
base_silver = k * g... | [
74694,
12958,
198,
2,
7030,
25,
259,
343,
618,
3423,
198,
2,
2696,
25,
220,
975,
6664,
220,
2366,
21,
271,
755,
4883,
8401,
1471,
11,
342,
997,
262,
4304,
28597,
709,
308,
311,
279,
24379,
5361,
315,
342,
7275,
262,
471,
308,
489,... | 368 | stop | null | 2,034,555,030 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 841 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1873_A | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Short Sort
There are three cards with letters $$$\texttt{a}$$$, $$$\texttt{b}$$$, $$$\texttt{c}$$$ placed in a row in some order. You can do the following operat... | null | 1873/A | {
"rating": 800,
"tags": [
"brute force",
"implementation"
],
"contest_id": "1873",
"index": "A",
"contest_start_year": 2023,
"n_official_tests": 5,
"official_tests_complete": true,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | **Short Sort**
===============
### Problem Statement
Given three letters, determine if it's possible to arrange them in the order `abc`.
### Solution
```python
def is_valid(s):
"""Check if s is a valid short sort."""
if set(s) != {'a', 'b', 'c'}:
return False
for i in range(len(s) - 1):
... | [
334,
12755,
16347,
1035,
46008,
271,
14711,
22854,
22504,
271,
22818,
2380,
12197,
11,
8417,
422,
433,
596,
3284,
311,
31993,
1124,
304,
279,
2015,
1595,
13997,
63438,
14711,
12761,
271,
74694,
12958,
198,
755,
374,
8501,
1161,
997,
262,
... | 385 | stop | null | 680,625,437 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 518 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1923_A | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Moving Chips
There is a ribbon divided into $$$n$$$ cells, numbered from $$$1$$$ to $$$n$$$ from left to right. Each cell either contains a chip or is free.
You... | null | 1923/A | {
"rating": 800,
"tags": [
"greedy",
"implementation"
],
"contest_id": "1923",
"index": "A",
"contest_start_year": 2024,
"n_official_tests": 1,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 2,
"memory_limit": 512
} | ```python
import sys
def min_operations(n, chips):
max_indices = [0] * n
min_length = 1
max_length = 0
for i in range(1, n):
if chips[i] == 1:
max_indices[i] = max_indices[i-1] + 1
max_length = max(max_length, max_indices[i])
else:
max_indices[i] = ... | [
74694,
12958,
271,
475,
5826,
271,
755,
1332,
58445,
1471,
11,
24512,
997,
262,
1973,
18839,
284,
510,
15,
60,
353,
308,
198,
262,
1332,
5228,
284,
220,
16,
198,
262,
1973,
5228,
284,
220,
15,
271,
262,
369,
602,
304,
2134,
7,
16,... | 218 | stop | null | 649,711,166 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 633 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1925_A | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: We Got Everything Covered!
You are given two positive integers $$$n$$$ and $$$k$$$.
Your task is to find a string $$$s$$$ such that all possible strings of leng... | null | 1925/A | {
"rating": 800,
"tags": [
"constructive algorithms",
"greedy",
"strings"
],
"contest_id": "1925",
"index": "A",
"contest_start_year": 2024,
"n_official_tests": 1,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
from collections import defaultdict
import sys
def print_result(s):
print(s)
def solve(n, k, s):
s = [None] + s
index = defaultdict(int)
result = []
for i in range(1, n + 1):
for j in range(1, k + 1):
index[s[i][j]] = i * k + j
for i in range(1, ... | [
74694,
12958,
198,
1527,
15661,
1179,
44008,
198,
475,
5826,
271,
755,
1194,
5400,
1161,
997,
262,
1194,
1161,
696,
755,
11886,
1471,
11,
597,
11,
274,
997,
262,
274,
284,
510,
4155,
60,
489,
274,
198,
262,
1963,
284,
44008,
1577,
3... | 340 | stop | null | 78,007,795 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 1,159 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1929_B | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Sasha and the Drawing
Even in kindergarten, Sasha liked a girl. Therefore, he wanted to give her a drawing and attract her attention.
As a drawing, he decided t... | null | 1929/B | {
"rating": 800,
"tags": [
"constructive algorithms",
"greedy",
"math"
],
"contest_id": "1929",
"index": "B",
"contest_start_year": 2024,
"n_official_tests": 1,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
import sys
def solve(n, k):
total_diagonals = 4 * n - 2
max_k = min(k, total_diagonals // 2 + 1)
min_cells = total_diagonals - max_k
return min_cells
def main():
t = int(input())
for _ in range(t):
n, k = map(int, input().split())
print(solve(n, k))
if __name__ ... | [
74694,
12958,
271,
475,
5826,
271,
755,
11886,
1471,
11,
597,
997,
262,
2860,
30577,
6241,
1147,
284,
220,
19,
353,
308,
482,
220,
17,
198,
262,
1973,
4803,
284,
1332,
6097,
11,
2860,
30577,
6241,
1147,
443,
220,
17,
489,
220,
16,
... | 110 | stop | null | 1,168,873,493 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 543 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1978_B | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: New Bakery
Bob decided to open a bakery. On the opening day, he baked $$$n$$$ buns that he can sell. The usual price of a bun is $$$a$$$ coins, but to attract cu... | null | 1978/B | {
"rating": 800,
"tags": [
"binary search",
"greedy",
"math",
"ternary search"
],
"contest_id": "1978",
"index": "B",
"contest_start_year": 2024,
"n_official_tests": 1,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
import sys
def solve(n, a, b):
if n == 0:
return 0
if a * n > b * (n - 1):
return a * n
else:
return b * (n - 1) - a * (n - 1) + a * n
def main():
t = int(input())
for _ in range(t):
n, a, b = map(int, input().split())
print(solve(n, a, b))
if __... | [
74694,
12958,
271,
475,
5826,
271,
755,
11886,
1471,
11,
264,
11,
293,
997,
262,
422,
308,
624,
220,
15,
512,
286,
471,
220,
15,
198,
262,
422,
264,
353,
308,
871,
293,
353,
320,
77,
482,
220,
16,
997,
286,
471,
264,
353,
308,
... | 126 | stop | null | 631,736,227 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 730 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1980_B | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Choosing Cubes
Dmitry has $$$n$$$ cubes, numbered from left to right from $$$1$$$ to $$$n$$$. The cube with index $$$f$$$ is his favorite.
Dmitry threw all the ... | null | 1980/B | {
"rating": 800,
"tags": [
"sortings",
"sortings"
],
"contest_id": "1980",
"index": "B",
"contest_start_year": 2024,
"n_official_tests": 2,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
def solve():
n, f, k = map(int, input().split())
arr = sorted(map(int, input().split()))
if f == 1:
if k > n - k:
return "YES"
else:
return "NO"
else:
if f == arr[k] or f == arr[k - 1]:
return "YES"
else:
return ... | [
74694,
12958,
271,
755,
11886,
4019,
262,
308,
11,
282,
11,
597,
284,
2472,
1577,
11,
1988,
1020,
7105,
2455,
262,
2961,
284,
10839,
9325,
1577,
11,
1988,
1020,
7105,
51062,
262,
422,
282,
624,
220,
16,
512,
286,
422,
597,
871,
308,... | 111 | stop | null | 145,257,381 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 866 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1985_B | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Maximum Multiple Sum
Given an integer $$$n$$$, find an integer $$$x$$$ such that:
- $$$2 \leq x \leq n$$$.
- The sum of multiples of $$$x$$$ that are less than ... | null | 1985/B | {
"rating": 800,
"tags": [
"brute force",
"math",
"number theory"
],
"contest_id": "1985",
"index": "B",
"contest_start_year": 2024,
"n_official_tests": 3,
"official_tests_complete": true,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
import sys
def max_multiple_sum(n):
"""
Calculate the maximum sum of multiples of x that is less than or equal to n.
Parameters:
n (int): The input integer.
Returns:
int: The maximum sum of multiples of x.
"""
return (n - 1) // 2 * 2 if n % 2 != 0 else (n - 1) // 2 * 3
def... | [
74694,
12958,
198,
475,
5826,
271,
755,
1973,
46333,
10370,
1471,
997,
262,
3270,
262,
21157,
279,
7340,
2694,
315,
66160,
315,
865,
430,
374,
2753,
1109,
477,
6273,
311,
308,
382,
262,
13831,
512,
262,
308,
320,
396,
1680,
578,
1988,... | 301 | stop | null | 2,102,133,942 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 485 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_1996_A | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Legs
It's another beautiful day on Farmer John's farm.
After Farmer John arrived at his farm, he counted $$$n$$$ legs. It is known only chickens and cows live o... | null | 1996/A | {
"rating": 800,
"tags": [
"binary search",
"math",
"ternary search"
],
"contest_id": "1996",
"index": "A",
"contest_start_year": 2024,
"n_official_tests": 1,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 2,
"memory_limit": 256
} | ```python
from sys import stdin
from math import gcd, sqrt
def min_animals(n):
return (n + 1) // 2
t = int(stdin.readline())
for _ in range(t):
n = int(stdin.readline())
print(min_animals(n))
``` | [
74694,
12958,
271,
1527,
5826,
1179,
32469,
198,
1527,
7033,
1179,
45958,
11,
18430,
271,
755,
1332,
12277,
25137,
1471,
997,
262,
471,
320,
77,
489,
220,
16,
8,
443,
220,
17,
271,
83,
284,
528,
70667,
32900,
12647,
2000,
721,
304,
... | 61 | stop | null | 1,963,984,969 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 313 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_404_A | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Valera and X
Valera is a little boy. Yesterday he got a huge Math hometask at school, so Valera didn't have enough time to properly learn the English alphabet fo... | null | 404/A | {
"rating": 1000,
"tags": [
"implementation"
],
"contest_id": "404",
"index": "A",
"contest_start_year": 2014,
"n_official_tests": 40,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
def is_letter_unique(letter, unique_letters):
if letter in unique_letters:
unique_letters.remove(letter)
return len(unique_letters) == 1
def is_x(n, letters):
# Diagonal check
if is_letter_unique(letters[0], letters):
return True
# Non-diagonal check
for i in range(n... | [
74694,
12958,
198,
755,
374,
47217,
21912,
66772,
11,
5016,
68430,
997,
262,
422,
6661,
304,
5016,
68430,
512,
286,
5016,
68430,
4955,
66772,
340,
262,
471,
2479,
54540,
68430,
8,
624,
220,
16,
1432,
755,
374,
3292,
1471,
11,
12197,
9... | 367 | stop | null | 1,372,070,994 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 454 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_758_B | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Blown Garland
Nothing is eternal in the world, Kostya understood it on the 7-th of January when he saw partially dead four-color garland.
Now he has a goal to r... | null | 758/B | {
"rating": 1100,
"tags": [
"brute force",
"implementation",
"number theory"
],
"contest_id": "758",
"index": "B",
"contest_start_year": 2017,
"n_official_tests": 65,
"official_tests_complete": true,
"has_checker": false,
"time_limit": 1,
"memory_limit": 256
} | ```python
# YOUR CODE HERE
def calculate_blown_bulbs(s):
"""
Calculate the number of dead light bulbs for each color in the garland.
Parameters:
s (str): The garland as a string of 'R', 'B', 'Y', 'G', '!' characters.
Returns:
tuple: A tuple of four integers representing the number of d... | [
74694,
12958,
198,
2,
21592,
14083,
19804,
198,
755,
11294,
13442,
785,
890,
360,
1302,
1161,
997,
262,
3270,
262,
21157,
279,
1396,
315,
5710,
3177,
54320,
369,
1855,
1933,
304,
279,
7515,
1974,
627,
1084,
262,
13831,
512,
262,
274,
... | 520 | stop | null | 1,446,793,276 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 713 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_798_A | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Mike and palindrome
Mike has a string s consisting of only lowercase English letters. He wants to change exactly one character from the string so that the result... | null | 798/A | {
"rating": 1000,
"tags": [
"brute force",
"constructive algorithms",
"strings"
],
"contest_id": "798",
"index": "A",
"contest_start_year": 2017,
"n_official_tests": 99,
"official_tests_complete": true,
"has_checker": false,
"time_limit": 2,
"memory_limit": 256
} | ```python
def palindrome(s):
left, right = 0, len(s) - 1
while left < right:
if s[left] != s[right]:
return False
left += 1
right -= 1
return True
def check(s):
for i in range(1, len(s)):
if palindrome(s[:i]) and palindrome(s[i:]):
return True
... | [
74694,
12958,
198,
755,
74197,
1161,
997,
262,
2163,
11,
1314,
284,
220,
15,
11,
2479,
1161,
8,
482,
220,
16,
198,
262,
1418,
2163,
366,
1314,
512,
286,
422,
274,
47602,
60,
976,
274,
54018,
10556,
310,
471,
3641,
198,
286,
2163,
... | 113 | stop | null | 1,768,430,329 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 291 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_835_B | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: The number on the board
Some natural number was written on the board. Its sum of digits was not less than k. But you were distracted a bit, and someone changed t... | null | 835/B | {
"rating": 1100,
"tags": [
"greedy"
],
"contest_id": "835",
"index": "B",
"contest_start_year": 2017,
"n_official_tests": 28,
"official_tests_complete": false,
"has_checker": false,
"time_limit": 2,
"memory_limit": 256
} | ```python
def main():
k = int(input())
n = int(input())
digit_sum_n = sum(int(digit) for digit in str(n))
min_digits = digit_sum_n - k
print(min_digits)
if __name__ == "__main__":
main()
```
Explanation:
1. The program reads the value of `k` and `n` from the input, respectively.
2. It ca... | [
74694,
12958,
198,
755,
1925,
4019,
262,
597,
284,
528,
5498,
2455,
262,
308,
284,
528,
5498,
12647,
262,
16099,
10370,
1107,
284,
2694,
1577,
1528,
12883,
8,
369,
16099,
304,
610,
1471,
1192,
262,
1332,
42532,
284,
16099,
10370,
1107,
... | 194 | stop | null | 343,233,862 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 326 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
code_cf_90_A | code | You will be given a competitive programming problem and will generate a correct Python program that matches the specification and passes all tests.
Problem: Cableway
A group of university students wants to get to the top of a mountain to have a picnic there. For that they decided to use a cableway.
A cableway is rep... | null | 90/A | {
"rating": 1000,
"tags": [
"greedy",
"math"
],
"contest_id": "90",
"index": "A",
"contest_start_year": 2011,
"n_official_tests": 55,
"official_tests_complete": true,
"has_checker": false,
"time_limit": 2,
"memory_limit": 256
} | ```python
def gcd(a, b):
"""Compute the greatest common divisor of a and b"""
while b:
a, b = b, a % b
return a
def lcm(a, b):
"""Compute the lowest common multiple of a and b"""
return a * b // gcd(a, b)
def solve():
"""Solve the problem and print the result"""
r, g, b = map(int, ... | [
74694,
12958,
198,
755,
45958,
2948,
11,
293,
997,
262,
4304,
47354,
279,
12474,
4279,
50209,
315,
264,
323,
293,
7275,
262,
1418,
293,
512,
286,
264,
11,
293,
284,
293,
11,
264,
1034,
293,
198,
262,
471,
264,
271,
755,
87179,
2948,... | 369 | stop | null | 830,379,721 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 724 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
general_supergpqa_0908602b64e24ead9813a8e398974ac3 | general | Answer the following multiple-choice question. Reason step by step, then give your final answer as the letter of the correct option within \boxed{}.
What is the molar mass of iron pentacarbonyl in g/mol?
A) 195.90
B) 195.80
C) 197.90
D) 196.90
E) 194.90
F) 196.80
G) 193.90
H) 195.89
I) 195.85
J) 195.88 | A | 0908602b64e24ead9813a8e398974ac3 | {
"answer_letter": "A",
"discipline": "Science",
"field": "Chemistry",
"difficulty": "middle",
"teacher_verdict": "correct",
"trace_source": "/orfeo/cephfs/home/dssc/francescortu/DetectDistill/data/exp_controlled_distill_v2_2026-09-07/training_data/correct_v1prompts_gptossmed.jsonl"
} | To find the molar mass of iron pentacarbonyl, we need to know the atomic masses of the individual elements involved and then calculate the total mass. Here's the step-by-step process:
1. Identify the chemical formula of iron pentacarbonyl: Fe(CO)5
2. The atomic mass of iron (Fe) is approximately 56 g/mol.
3. The atomi... | [
1271,
1505,
279,
296,
7569,
3148,
315,
11245,
20801,
582,
76370,
3633,
75,
11,
584,
1205,
311,
1440,
279,
25524,
32738,
315,
279,
3927,
5540,
6532,
323,
1243,
11294,
279,
2860,
3148,
13,
5810,
596,
279,
3094,
14656,
30308,
1920,
1473,
... | 696 | stop | null | 1,035,506,170 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 150 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
general_supergpqa_0baf26cb96504b8db75612513225b4f6 | general | Answer the following multiple-choice question. Reason step by step, then give your final answer as the letter of the correct option within \boxed{}.
Where do the calcium ions come from during skeletal muscle filament sliding?
A) Sarcoplasmic reticulum
B) Endoplasmic reticulum
C) Longitudinal tubules
D) Nuclear envelo... | I | 0baf26cb96504b8db75612513225b4f6 | {
"answer_letter": "I",
"discipline": "Medicine",
"field": "Basic Medicine",
"difficulty": "middle",
"teacher_verdict": "incorrect",
"trace_source": "/orfeo/cephfs/home/dssc/francescortu/DetectDistill/data/exp_controlled_distill_v2_2026-09-07/training_data/correct_v1prompts_gptossmed.jsonl"
} | To answer this question, let's go through the process step by step.
1. **Skeletal muscle filament sliding**: This process involves the sliding of actin and myosin filaments along each other. It's a critical mechanism for muscle contraction.
2. **Sarcoplasmic reticulum (A)**: This is involved in the storage and releas... | [
1271,
4320,
420,
3488,
11,
1095,
596,
733,
1555,
279,
1920,
3094,
555,
3094,
382,
16,
13,
3146,
50,
86255,
16124,
91880,
34932,
96618,
1115,
1920,
18065,
279,
34932,
315,
1180,
258,
323,
856,
437,
258,
1488,
24469,
3235,
1855,
1023,
1... | 491 | stop | null | 157,473,455 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 150 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
general_supergpqa_0d51abb8e20d4e9593888b3574c8c305 | general | Answer the following multiple-choice question. Reason step by step, then give your final answer as the letter of the correct option within \boxed{}.
The more soluble the gas is during absorption, the more the phase equilibrium constant m(), Henry's coefficient E(), and Henry's coefficient H().
A) Smaller, smaller, eq... | I | 0d51abb8e20d4e9593888b3574c8c305 | {
"answer_letter": "I",
"discipline": "Engineering",
"field": "Chemical Engineering and Technology",
"difficulty": "middle",
"teacher_verdict": "incorrect",
"trace_source": "/orfeo/cephfs/home/dssc/francescortu/DetectDistill/data/exp_controlled_distill_v2_2026-09-07/training_data/correct_v1prompts_gptossmed... | To solve this question, let's analyze the relationship between the solubility of a gas and the phase equilibrium constant, Henry's coefficient, and Henry's coefficient.
1. **Henry's Coefficient (H())**: Henry's coefficient is directly related to the solubility of a gas in a liquid. A higher solubility of the gas means... | [
1271,
11886,
420,
3488,
11,
1095,
596,
24564,
279,
5133,
1990,
279,
2092,
392,
1429,
315,
264,
6962,
323,
279,
10474,
56411,
6926,
11,
18063,
596,
36706,
11,
323,
18063,
596,
36706,
382,
16,
13,
3146,
64463,
596,
3623,
43870,
320,
39,... | 289 | stop | null | 642,377,872 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 177 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
general_supergpqa_1a9d06ad259d44d99c0808f0f576bee3 | general | Answer the following multiple-choice question. Reason step by step, then give your final answer as the letter of the correct option within \boxed{}.
Hard core Preserved eggs use ______ more than sugar core Preserved eggs.
A) Brown cane sugar
B) Wood charcoal
C) Acetic acid
D) Grass ash or plant ash
E) Lead monoxide
F... | D | 1a9d06ad259d44d99c0808f0f576bee3 | {
"answer_letter": "D",
"discipline": "Engineering",
"field": "Food Science and Engineering",
"difficulty": "middle",
"teacher_verdict": "correct",
"trace_source": "/orfeo/cephfs/home/dssc/francescortu/DetectDistill/data/exp_controlled_distill_v2_2026-09-07/training_data/correct_v1prompts_gptossmed.jsonl"
} | To solve this question, let's break down the key terms and their characteristics:
1. **Hard core**: This refers to a specific type of preservation used in baking and cooking. Hard core refers to the baking soda (sodium bicarbonate) that reacts with acidic substances to produce carbon dioxide gas, causing the eggs to r... | [
1271,
11886,
420,
3488,
11,
1095,
596,
1464,
1523,
279,
1401,
3878,
323,
872,
17910,
1473,
16,
13,
3146,
28005,
6332,
96618,
1115,
19813,
311,
264,
3230,
955,
315,
46643,
1511,
304,
28915,
323,
17677,
13,
11481,
6332,
19813,
311,
279,
... | 214 | stop | null | 1,941,240,612 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 136 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
general_supergpqa_1ae0a74ab426430d9a92d82a4defa068 | general | Answer the following multiple-choice question. Reason step by step, then give your final answer as the letter of the correct option within \boxed{}.
Standing waves are produced by a 100-Hz generator in a string of fixed length. The tension in the string is increased until a new set of standing waves is produced. Will ... | C | 1ae0a74ab426430d9a92d82a4defa068 | {
"answer_letter": "C",
"discipline": "Science",
"field": "Physics",
"difficulty": "middle",
"teacher_verdict": "correct",
"trace_source": "/orfeo/cephfs/home/dssc/francescortu/DetectDistill/data/exp_controlled_distill_v2_2026-09-07/training_data/correct_v1prompts_gptossmed.jsonl"
} | Let's analyze the problem step by step:
1. Standing waves are produced by a 100-Hz generator in a string of fixed length.
2. The tension in the string is increased until a new set of standing waves is produced.
Standing waves are created when the wave speed is constant. The tension in the string is related to the wav... | [
10267,
596,
24564,
279,
3575,
3094,
555,
3094,
1473,
16,
13,
46327,
17301,
527,
9124,
555,
264,
220,
1041,
11529,
89,
14143,
304,
264,
925,
315,
8521,
3160,
627,
17,
13,
578,
24408,
304,
279,
925,
374,
7319,
3156,
264,
502,
743,
315... | 269 | stop | null | 1,829,420,325 | 0.8 | 0.95 | 0 | 1 | [
128001,
128008,
128009
] | 32,768 | false | 350 | 65,536 | meta-llama/Llama-3.2-1B-Instruct | 9213176726f574b556790deb65791e0c5aa438b6 |
DetectDistill v5 β SuperGPQA teacher traces, evaluation sets and rephrasing campaign records
Experiment exp_controlled_distill_easy_v5_2026-10-09 of the DetectDistill project: SFT distillation of reasoning traces from two teachers (gpt-oss-120b effort
medium; GLM-5.3 effort high) into eight instruct students, plus a campaign that repeats the successful pairs on faithful
MiMo-V2.5 rephrasings of the same traces. Adapters: francescortu/detectdistill-v5-lora-students.
Code: https://github.com/francescortu/DetectDistill (branch v2-orfeo), src/exp_controlled_distill_easy_v5_2026-10-09. Card generated 2026-10-19 10:15 CEST.
Immutable dataset versions
| Path | Rows | Version |
|---|---|---|
datasets/evaluation_v1/ |
{'mixed100': 100, 'indist200': 200} | evaluation_v1 |
datasets/glm53high_mimo_rephrased_v1/ |
3596 | glm53high_mimo_rephrased_v1 |
datasets/glm53high_original_v1/ |
3605 | glm53high_original_v1 |
datasets/gptossmed_mimo_rephrased_v1/ |
3280 | gptossmed_mimo_rephrased_v1 |
datasets/gptossmed_original_v1/ |
3284 | gptossmed_original_v1 |
Each version has a manifest.json (source runs, teacher and request settings, filtering rules, per-file sha256, counts, known
per-student exclusions, licenses) and keeps the reconstruction records in provenance/ (raw OpenRouter records, verdicts, filter
report, candidate list). The 1,586 reused gpt-oss traces of gptossmed_original_v1 are published once in
francescortu/detectdistill-v2-data (training_data/correct_v1prompts_gptossmed.jsonl,
pinned revision and sha256 in the manifest).
Row schema: prompt_id, user_prompt (multiple-choice prompt), reasoning (teacher reasoning, trained inside <think>β¦</think>),
answer (final answer with \boxed{letter}), extracted (boxed letter), origin, teacher. Rows are in the order every
baseline used before shuffling (ids.txt). Students that could not fit some rows in their context dropped them (never truncated);
the dropped ids per baseline run are in the manifest.
Evaluation sets (datasets/evaluation_v1/)
mixed100/: 34 MATH (levels 1-4), 34 Codeforces (rating 800-1100, official tests in code_tests.jsonl), 32 SuperGPQA.
indist200/: 200 SuperGPQA Science/Engineering/Medicine questions, disjoint from every traced or trained question. code/ holds
the scorer and evaluation scripts. evaluations/<run>/<split>/<label>/scored.jsonl hold every per-question generation and verdict of
every v5 run (base and epochs), including negative results.
Rephrasing campaign (campaign/)
Eligibility of the 16 student-teacher pairs, budget ledger summary, validation and Haiku-review records, run registry and backup log. Selection is exploratory (single-sample evaluations).
Eligibility of the 16 student-teacher pairs (MiMo rephrasing campaign)
Generated 2026-10-16 13:28 CEST by eligibility.py from saved artifacts. Rule: max(E1..E5) > base on the 200-question in-distribution SuperGPQA evaluation of the baseline pair. This is an exploratory selection on single-sample vLLM evaluations; it is not evidence of a reliable or significant gain (same-model base scores differ by up to 9/200 between runs). The 100-question mixed set is shown for information only.
| Student | Teacher | Baseline | Base | E1-E5 (in-dist /200) | Best (epoch) | Gain | Status | Mixed-100 base β E1-E5 (info) |
|---|---|---|---|---|---|---|---|---|
| Llama-3.1-8B-Instruct | gptossmed | run_v1_2026-10-09 | 39 | 49/53/56/61/62 | 62 (E5) | +23 | eligible | 42 β 36/39/36/38/36 |
| Llama-3.1-8B-Instruct | glm53high | run_v3_2026-10-13 | 39 | 50/57/46/56/50 | 57 (E2) | +18 | eligible | 42 β 36/38/34/36/35 |
| Mistral-7B-Instruct-v0.3 | gptossmed | run_v4_2026-10-13 | 26 | 33/37/42/41/49 | 49 (E5) | +23 | eligible | 16 β 14/15/15/16/17 |
| Mistral-7B-Instruct-v0.3 | glm53high | run_v6_2026-10-14 | 26 | 40/35/39/43/45 | 45 (E5) | +19 | eligible | 16 β 18/12/9/14/18 |
| Qwen2.5-3B-Instruct | gptossmed | run_v5_2026-10-13 | 60 | 37/47/45/46/52 | 52 (E5) | -8 | ineligible | 41 β 30/29/30/30/36 |
| Qwen2.5-3B-Instruct | glm53high | run_v8_2026-10-14 | 60 | 41/33/36/33/33 | 41 (E1) | -19 | ineligible | 35 β 29/28/30/34/32 |
| Qwen2.5-0.5B-Instruct | gptossmed | run_v7_2026-10-14 | 17 | 22/31/23/33/26 | 33 (E4) | +16 | eligible | 20 β 11/4/8/9/7 |
| Qwen2.5-0.5B-Instruct | glm53high | run_v11_2026-10-14 | 26 | 20/22/23/26/28 | 28 (E5) | +2 | eligible | 20 β 11/12/12/10/11 |
| Llama-3.2-1B-Instruct | gptossmed | run_v9_2026-10-14 | 10 | 35/28/34/30/24 | 35 (E1) | +25 | eligible | 13 β 14/14/17/23/11 |
| Llama-3.2-1B-Instruct | glm53high | run_v10_2026-10-14 | 10 | 34/21/37/27/33 | 37 (E3) | +27 | eligible | 11 β 18/18/19/22/26 |
| Falcon3-7B-Instruct | gptossmed | run_v12_2026-10-15 | 44 | 49/54/51/58/57 | 58 (E4) | +14 | eligible | 38 β 35/37/36/39/38 |
| Falcon3-7B-Instruct | glm53high | run_v13_2026-10-15 | 46 | 55/41/44/38/40 | 55 (E1) | +9 | eligible | 35 β 31/27/31/30/33 |
| gemma-3-1b-it | gptossmed | run_v14_2026-10-15 | 3 | 20/17/28/22/34 | 34 (E5) | +31 | eligible by rule; excluded by user (Gemma) | 28 β 9/8/8/8/9 |
| gemma-3-1b-it | glm53high | run_v15_2026-10-15 | 6 | 23/21/23/32/37 | 37 (E5) | +31 | eligible by rule; excluded by user (Gemma) | 26 β 11/8/14/6/11 |
| gemma-3-4b-it (text decoder) | gptossmed | run_v16_2026-10-15 | 33 | 27/43/35/44/41 | 44 (E4) | +11 | eligible by rule; excluded by user (Gemma) | 52 β 32/37/36/41/38 |
| gemma-3-4b-it (text decoder) | glm53high | run_v17_2026-10-15 | 33 | 32/28/31/31/35 | 35 (E5) | +2 | eligible by rule; excluded by user (Gemma) | 53 β 23/25/26/24/24 |
Counts: {'eligible': 10, 'ineligible': 2, 'unresolved': 0, 'excluded_by_user': 4}.
Licenses and attribution
Questions: SuperGPQA (ODC-BY 1.0; cite arXiv:2502.14739); MATH and Codeforces problems keep their original terms. Answers/reasoning were generated through OpenRouter by gpt-oss-120b (Apache-2.0 weights) and GLM-5.3 (z-ai terms); rephrased versions by Xiaomi MiMo-V2.5, whose weight license does not relicense the underlying content. No additional license is granted; check each source's terms before reuse.
Restore
from huggingface_hub import snapshot_download
d = snapshot_download("francescortu/detectdistill-v5-data", repo_type="dataset", revision="<sha from UPLOAD_MANIFEST.json>",
allow_patterns=["datasets/gptossmed_original_v1/*"])
# verify: every file's sha256 equals datasets/<version>/manifest.json["files"][path]["sha256"]
- Downloads last month
- 2,024