Dataset Viewer
Auto-converted to Parquet Duplicate
problem_id
stringclasses
20 values
language
stringclasses
8 values
tiobe_rank
int64
1
47
prompt
stringlengths
557
760
M01
Python
1
Solve the following programming problem in Python. ## Problem: Palindrome Check Read a string S and determine whether it reads the same forwards and backwards, comparing characters exactly (case-sensitive and including punctuation). Output 'yes' for palindromes and 'no' otherwise. ## Examples Input: racecar Exp...
M02
Python
1
Solve the following programming problem in Python. ## Problem: Word Count Read a line consisting of words separated by single spaces. Count how many words appear (non-empty sequences between spaces) and output that integer. ## Examples Input: hello world Expected Output: 2 Input: one two three Expected Outp...
M03
Python
1
Solve the following programming problem in Python. ## Problem: Run Length Encoding Read a string S and produce its run-length encoding: for each maximal block of identical characters, output the character followed immediately by the length of the block as a decimal integer. Concatenate all blocks and output the resul...
M04
Python
1
Solve the following programming problem in Python. ## Problem: Caesar Shift By 3 Read a lowercase alphabetic string S. Shift each letter forward by 3 positions in the English alphabet (wrapping z to c) and output the transformed string. Non-letter characters will not appear. ## Examples Input: abc Expected Outp...
M05
Python
1
Solve the following programming problem in Python. ## Problem: Simple Binary Expression Read an expression formatted as 'a op b' with single spaces, where a and b are integers and op is one of '+', '-', or '*'. Evaluate the expression using integer arithmetic and output the result as an integer. ## Examples Input...
M06
Python
1
Solve the following programming problem in Python. ## Problem: Greatest Common Divisor Read two integers a and b separated by whitespace. Compute their greatest common divisor as a positive integer and output that value. ## Examples Input: 12 18 Expected Output: 6 Input: 7 5 Expected Output: 1 ## Requireme...
M07
Python
1
Solve the following programming problem in Python. ## Problem: Factorial Read an integer N with 0 ≤ N ≤ 10. Compute N! (the factorial) using integer arithmetic and output the result. ## Examples Input: 5 Expected Output: 120 Input: 0 Expected Output: 1 ## Requirements - Write a complete, self-contained pr...
M08
Python
1
Solve the following programming problem in Python. ## Problem: Nth Fibonacci Number Read an integer N ≥ 1 and output the Nth Fibonacci number using the 1-indexed sequence with F1 = 1 and F2 = 1. Use arbitrary-precision integers if needed. ## Examples Input: 1 Expected Output: 1 Input: 5 Expected Output: 5 ...
M09
Python
1
Solve the following programming problem in Python. ## Problem: Decimal To Binary Read a non-negative integer N in decimal. Output its binary representation without leading zeros (except print '0' when N = 0). ## Examples Input: 5 Expected Output: 101 Input: 8 Expected Output: 1000 ## Requirements - Write ...
M10
Python
1
Solve the following programming problem in Python. ## Problem: Binary To Decimal Read a string consisting only of characters '0' and '1'. Interpret it as a binary number and output the corresponding decimal integer without extra text. ## Examples Input: 101 Expected Output: 5 Input: 1000 Expected Output: 8 ...
M11
Python
1
Solve the following programming problem in Python. ## Problem: Substring Occurrences Read a string S on the first line and a pattern P on the second line. Count how many times P appears in S, allowing overlapping matches, and output that integer count. ## Examples Input: aaaa aa Expected Output: 3 Input: abca...
M12
Python
1
Solve the following programming problem in Python. ## Problem: Remove Vowels Read a line of text and remove every vowel character (a, e, i, o, u in both uppercase and lowercase). Output the filtered string preserving the order of the remaining characters. ## Examples Input: hello Expected Output: hll Input: E...
M13
Python
1
Solve the following programming problem in Python. ## Problem: Sort Numbers Read an integer N on the first line followed by a second line containing N integers separated by spaces. Output the integers sorted in ascending order separated by single spaces. ## Examples Input: 5 3 1 4 1 2 Expected Output: 1 1 2 3 4...
M14
Python
1
Solve the following programming problem in Python. ## Problem: Second Largest Distinct Number Read an integer N ≥ 2 followed by N integers on the next line. Consider the distinct values and output the second largest distinct value. Inputs are guaranteed to contain at least two distinct numbers. ## Examples Input:...
M15
Python
1
Solve the following programming problem in Python. ## Problem: Anagram Test Read two lowercase strings S1 and S2 (no spaces) on separate lines. Output 'yes' if S1 and S2 contain exactly the same characters with the same multiplicities (anagrams), otherwise output 'no'. ## Examples Input: listen silent Expected ...
M16
Python
1
Solve the following programming problem in Python. ## Problem: Interleave Two Strings Read two strings S1 and S2 of equal length on separate lines. Construct a new string by alternating characters: S1[0], S2[0], S1[1], S2[1], ... until the end. Output the interleaved string. ## Examples Input: abc XYZ Expected ...
M17
Python
1
Solve the following programming problem in Python. ## Problem: Replace Spaces With Underscores Read a line of text and output the same string but with every space character replaced by an underscore ('_'). All other characters stay unchanged. ## Examples Input: hello world Expected Output: hello_world Input: ...
M18
Python
1
Solve the following programming problem in Python. ## Problem: Sum Of List Read an integer N followed by a line of N integers separated by spaces. Sum the integers exactly and output the total. ## Examples Input: 4 1 2 3 4 Expected Output: 10 Input: 3 10 -5 -5 Expected Output: 0 ## Requirements - Write a ...
M19
Python
1
Solve the following programming problem in Python. ## Problem: Characters At Even Indices Read a string S and output a new string consisting of the characters at even indices (0-based) from S in their original order. ## Examples Input: abcdef Expected Output: ace Input: a Expected Output: a ## Requirements...
M20
Python
1
Solve the following programming problem in Python. ## Problem: Count Distinct Characters Read a string S and output the number of distinct characters present in S. Treat uppercase and lowercase as different characters. ## Examples Input: aaa Expected Output: 1 Input: abca Expected Output: 3 ## Requirements...
M01
C++
3
Solve the following programming problem in C++. ## Problem: Palindrome Check Read a string S and determine whether it reads the same forwards and backwards, comparing characters exactly (case-sensitive and including punctuation). Output 'yes' for palindromes and 'no' otherwise. ## Examples Input: racecar Expect...
M02
C++
3
Solve the following programming problem in C++. ## Problem: Word Count Read a line consisting of words separated by single spaces. Count how many words appear (non-empty sequences between spaces) and output that integer. ## Examples Input: hello world Expected Output: 2 Input: one two three Expected Output:...
M03
C++
3
Solve the following programming problem in C++. ## Problem: Run Length Encoding Read a string S and produce its run-length encoding: for each maximal block of identical characters, output the character followed immediately by the length of the block as a decimal integer. Concatenate all blocks and output the resultin...
M04
C++
3
Solve the following programming problem in C++. ## Problem: Caesar Shift By 3 Read a lowercase alphabetic string S. Shift each letter forward by 3 positions in the English alphabet (wrapping z to c) and output the transformed string. Non-letter characters will not appear. ## Examples Input: abc Expected Output:...
M05
C++
3
Solve the following programming problem in C++. ## Problem: Simple Binary Expression Read an expression formatted as 'a op b' with single spaces, where a and b are integers and op is one of '+', '-', or '*'. Evaluate the expression using integer arithmetic and output the result as an integer. ## Examples Input: 3...
M06
C++
3
Solve the following programming problem in C++. ## Problem: Greatest Common Divisor Read two integers a and b separated by whitespace. Compute their greatest common divisor as a positive integer and output that value. ## Examples Input: 12 18 Expected Output: 6 Input: 7 5 Expected Output: 1 ## Requirements...
M07
C++
3
Solve the following programming problem in C++. ## Problem: Factorial Read an integer N with 0 ≤ N ≤ 10. Compute N! (the factorial) using integer arithmetic and output the result. ## Examples Input: 5 Expected Output: 120 Input: 0 Expected Output: 1 ## Requirements - Write a complete, self-contained progr...
M08
C++
3
Solve the following programming problem in C++. ## Problem: Nth Fibonacci Number Read an integer N ≥ 1 and output the Nth Fibonacci number using the 1-indexed sequence with F1 = 1 and F2 = 1. Use arbitrary-precision integers if needed. ## Examples Input: 1 Expected Output: 1 Input: 5 Expected Output: 5 ## ...
M09
C++
3
Solve the following programming problem in C++. ## Problem: Decimal To Binary Read a non-negative integer N in decimal. Output its binary representation without leading zeros (except print '0' when N = 0). ## Examples Input: 5 Expected Output: 101 Input: 8 Expected Output: 1000 ## Requirements - Write a c...
M10
C++
3
Solve the following programming problem in C++. ## Problem: Binary To Decimal Read a string consisting only of characters '0' and '1'. Interpret it as a binary number and output the corresponding decimal integer without extra text. ## Examples Input: 101 Expected Output: 5 Input: 1000 Expected Output: 8 ##...
M11
C++
3
Solve the following programming problem in C++. ## Problem: Substring Occurrences Read a string S on the first line and a pattern P on the second line. Count how many times P appears in S, allowing overlapping matches, and output that integer count. ## Examples Input: aaaa aa Expected Output: 3 Input: abcabc ...
M12
C++
3
Solve the following programming problem in C++. ## Problem: Remove Vowels Read a line of text and remove every vowel character (a, e, i, o, u in both uppercase and lowercase). Output the filtered string preserving the order of the remaining characters. ## Examples Input: hello Expected Output: hll Input: Esot...
M13
C++
3
Solve the following programming problem in C++. ## Problem: Sort Numbers Read an integer N on the first line followed by a second line containing N integers separated by spaces. Output the integers sorted in ascending order separated by single spaces. ## Examples Input: 5 3 1 4 1 2 Expected Output: 1 1 2 3 4 ...
M14
C++
3
Solve the following programming problem in C++. ## Problem: Second Largest Distinct Number Read an integer N ≥ 2 followed by N integers on the next line. Consider the distinct values and output the second largest distinct value. Inputs are guaranteed to contain at least two distinct numbers. ## Examples Input: 4 ...
M15
C++
3
Solve the following programming problem in C++. ## Problem: Anagram Test Read two lowercase strings S1 and S2 (no spaces) on separate lines. Output 'yes' if S1 and S2 contain exactly the same characters with the same multiplicities (anagrams), otherwise output 'no'. ## Examples Input: listen silent Expected Out...
M16
C++
3
Solve the following programming problem in C++. ## Problem: Interleave Two Strings Read two strings S1 and S2 of equal length on separate lines. Construct a new string by alternating characters: S1[0], S2[0], S1[1], S2[1], ... until the end. Output the interleaved string. ## Examples Input: abc XYZ Expected Out...
M17
C++
3
Solve the following programming problem in C++. ## Problem: Replace Spaces With Underscores Read a line of text and output the same string but with every space character replaced by an underscore ('_'). All other characters stay unchanged. ## Examples Input: hello world Expected Output: hello_world Input: a b...
M18
C++
3
Solve the following programming problem in C++. ## Problem: Sum Of List Read an integer N followed by a line of N integers separated by spaces. Sum the integers exactly and output the total. ## Examples Input: 4 1 2 3 4 Expected Output: 10 Input: 3 10 -5 -5 Expected Output: 0 ## Requirements - Write a com...
M19
C++
3
Solve the following programming problem in C++. ## Problem: Characters At Even Indices Read a string S and output a new string consisting of the characters at even indices (0-based) from S in their original order. ## Examples Input: abcdef Expected Output: ace Input: a Expected Output: a ## Requirements -...
M20
C++
3
Solve the following programming problem in C++. ## Problem: Count Distinct Characters Read a string S and output the number of distinct characters present in S. Treat uppercase and lowercase as different characters. ## Examples Input: aaa Expected Output: 1 Input: abca Expected Output: 3 ## Requirements -...
M01
Java
4
Solve the following programming problem in Java. ## Problem: Palindrome Check Read a string S and determine whether it reads the same forwards and backwards, comparing characters exactly (case-sensitive and including punctuation). Output 'yes' for palindromes and 'no' otherwise. ## Examples Input: racecar Expec...
M02
Java
4
Solve the following programming problem in Java. ## Problem: Word Count Read a line consisting of words separated by single spaces. Count how many words appear (non-empty sequences between spaces) and output that integer. ## Examples Input: hello world Expected Output: 2 Input: one two three Expected Output...
M03
Java
4
Solve the following programming problem in Java. ## Problem: Run Length Encoding Read a string S and produce its run-length encoding: for each maximal block of identical characters, output the character followed immediately by the length of the block as a decimal integer. Concatenate all blocks and output the resulti...
M04
Java
4
Solve the following programming problem in Java. ## Problem: Caesar Shift By 3 Read a lowercase alphabetic string S. Shift each letter forward by 3 positions in the English alphabet (wrapping z to c) and output the transformed string. Non-letter characters will not appear. ## Examples Input: abc Expected Output...
M05
Java
4
Solve the following programming problem in Java. ## Problem: Simple Binary Expression Read an expression formatted as 'a op b' with single spaces, where a and b are integers and op is one of '+', '-', or '*'. Evaluate the expression using integer arithmetic and output the result as an integer. ## Examples Input: ...
M06
Java
4
Solve the following programming problem in Java. ## Problem: Greatest Common Divisor Read two integers a and b separated by whitespace. Compute their greatest common divisor as a positive integer and output that value. ## Examples Input: 12 18 Expected Output: 6 Input: 7 5 Expected Output: 1 ## Requirement...
M07
Java
4
Solve the following programming problem in Java. ## Problem: Factorial Read an integer N with 0 ≤ N ≤ 10. Compute N! (the factorial) using integer arithmetic and output the result. ## Examples Input: 5 Expected Output: 120 Input: 0 Expected Output: 1 ## Requirements - Write a complete, self-contained prog...
M08
Java
4
Solve the following programming problem in Java. ## Problem: Nth Fibonacci Number Read an integer N ≥ 1 and output the Nth Fibonacci number using the 1-indexed sequence with F1 = 1 and F2 = 1. Use arbitrary-precision integers if needed. ## Examples Input: 1 Expected Output: 1 Input: 5 Expected Output: 5 ##...
M09
Java
4
Solve the following programming problem in Java. ## Problem: Decimal To Binary Read a non-negative integer N in decimal. Output its binary representation without leading zeros (except print '0' when N = 0). ## Examples Input: 5 Expected Output: 101 Input: 8 Expected Output: 1000 ## Requirements - Write a ...
M10
Java
4
Solve the following programming problem in Java. ## Problem: Binary To Decimal Read a string consisting only of characters '0' and '1'. Interpret it as a binary number and output the corresponding decimal integer without extra text. ## Examples Input: 101 Expected Output: 5 Input: 1000 Expected Output: 8 #...
M11
Java
4
Solve the following programming problem in Java. ## Problem: Substring Occurrences Read a string S on the first line and a pattern P on the second line. Count how many times P appears in S, allowing overlapping matches, and output that integer count. ## Examples Input: aaaa aa Expected Output: 3 Input: abcabc...
M12
Java
4
Solve the following programming problem in Java. ## Problem: Remove Vowels Read a line of text and remove every vowel character (a, e, i, o, u in both uppercase and lowercase). Output the filtered string preserving the order of the remaining characters. ## Examples Input: hello Expected Output: hll Input: Eso...
M13
Java
4
Solve the following programming problem in Java. ## Problem: Sort Numbers Read an integer N on the first line followed by a second line containing N integers separated by spaces. Output the integers sorted in ascending order separated by single spaces. ## Examples Input: 5 3 1 4 1 2 Expected Output: 1 1 2 3 4 ...
M14
Java
4
Solve the following programming problem in Java. ## Problem: Second Largest Distinct Number Read an integer N ≥ 2 followed by N integers on the next line. Consider the distinct values and output the second largest distinct value. Inputs are guaranteed to contain at least two distinct numbers. ## Examples Input: 4...
M15
Java
4
Solve the following programming problem in Java. ## Problem: Anagram Test Read two lowercase strings S1 and S2 (no spaces) on separate lines. Output 'yes' if S1 and S2 contain exactly the same characters with the same multiplicities (anagrams), otherwise output 'no'. ## Examples Input: listen silent Expected Ou...
M16
Java
4
Solve the following programming problem in Java. ## Problem: Interleave Two Strings Read two strings S1 and S2 of equal length on separate lines. Construct a new string by alternating characters: S1[0], S2[0], S1[1], S2[1], ... until the end. Output the interleaved string. ## Examples Input: abc XYZ Expected Ou...
M17
Java
4
Solve the following programming problem in Java. ## Problem: Replace Spaces With Underscores Read a line of text and output the same string but with every space character replaced by an underscore ('_'). All other characters stay unchanged. ## Examples Input: hello world Expected Output: hello_world Input: a ...
M18
Java
4
Solve the following programming problem in Java. ## Problem: Sum Of List Read an integer N followed by a line of N integers separated by spaces. Sum the integers exactly and output the total. ## Examples Input: 4 1 2 3 4 Expected Output: 10 Input: 3 10 -5 -5 Expected Output: 0 ## Requirements - Write a co...
M19
Java
4
Solve the following programming problem in Java. ## Problem: Characters At Even Indices Read a string S and output a new string consisting of the characters at even indices (0-based) from S in their original order. ## Examples Input: abcdef Expected Output: ace Input: a Expected Output: a ## Requirements ...
M20
Java
4
Solve the following programming problem in Java. ## Problem: Count Distinct Characters Read a string S and output the number of distinct characters present in S. Treat uppercase and lowercase as different characters. ## Examples Input: aaa Expected Output: 1 Input: abca Expected Output: 3 ## Requirements ...
M01
Perl
11
Solve the following programming problem in Perl. ## Problem: Palindrome Check Read a string S and determine whether it reads the same forwards and backwards, comparing characters exactly (case-sensitive and including punctuation). Output 'yes' for palindromes and 'no' otherwise. ## Examples Input: racecar Expec...
M02
Perl
11
Solve the following programming problem in Perl. ## Problem: Word Count Read a line consisting of words separated by single spaces. Count how many words appear (non-empty sequences between spaces) and output that integer. ## Examples Input: hello world Expected Output: 2 Input: one two three Expected Output...
M03
Perl
11
Solve the following programming problem in Perl. ## Problem: Run Length Encoding Read a string S and produce its run-length encoding: for each maximal block of identical characters, output the character followed immediately by the length of the block as a decimal integer. Concatenate all blocks and output the resulti...
M04
Perl
11
Solve the following programming problem in Perl. ## Problem: Caesar Shift By 3 Read a lowercase alphabetic string S. Shift each letter forward by 3 positions in the English alphabet (wrapping z to c) and output the transformed string. Non-letter characters will not appear. ## Examples Input: abc Expected Output...
M05
Perl
11
Solve the following programming problem in Perl. ## Problem: Simple Binary Expression Read an expression formatted as 'a op b' with single spaces, where a and b are integers and op is one of '+', '-', or '*'. Evaluate the expression using integer arithmetic and output the result as an integer. ## Examples Input: ...
M06
Perl
11
Solve the following programming problem in Perl. ## Problem: Greatest Common Divisor Read two integers a and b separated by whitespace. Compute their greatest common divisor as a positive integer and output that value. ## Examples Input: 12 18 Expected Output: 6 Input: 7 5 Expected Output: 1 ## Requirement...
M07
Perl
11
Solve the following programming problem in Perl. ## Problem: Factorial Read an integer N with 0 ≤ N ≤ 10. Compute N! (the factorial) using integer arithmetic and output the result. ## Examples Input: 5 Expected Output: 120 Input: 0 Expected Output: 1 ## Requirements - Write a complete, self-contained prog...
M08
Perl
11
Solve the following programming problem in Perl. ## Problem: Nth Fibonacci Number Read an integer N ≥ 1 and output the Nth Fibonacci number using the 1-indexed sequence with F1 = 1 and F2 = 1. Use arbitrary-precision integers if needed. ## Examples Input: 1 Expected Output: 1 Input: 5 Expected Output: 5 ##...
M09
Perl
11
Solve the following programming problem in Perl. ## Problem: Decimal To Binary Read a non-negative integer N in decimal. Output its binary representation without leading zeros (except print '0' when N = 0). ## Examples Input: 5 Expected Output: 101 Input: 8 Expected Output: 1000 ## Requirements - Write a ...
M10
Perl
11
Solve the following programming problem in Perl. ## Problem: Binary To Decimal Read a string consisting only of characters '0' and '1'. Interpret it as a binary number and output the corresponding decimal integer without extra text. ## Examples Input: 101 Expected Output: 5 Input: 1000 Expected Output: 8 #...
M11
Perl
11
Solve the following programming problem in Perl. ## Problem: Substring Occurrences Read a string S on the first line and a pattern P on the second line. Count how many times P appears in S, allowing overlapping matches, and output that integer count. ## Examples Input: aaaa aa Expected Output: 3 Input: abcabc...
M12
Perl
11
Solve the following programming problem in Perl. ## Problem: Remove Vowels Read a line of text and remove every vowel character (a, e, i, o, u in both uppercase and lowercase). Output the filtered string preserving the order of the remaining characters. ## Examples Input: hello Expected Output: hll Input: Eso...
M13
Perl
11
Solve the following programming problem in Perl. ## Problem: Sort Numbers Read an integer N on the first line followed by a second line containing N integers separated by spaces. Output the integers sorted in ascending order separated by single spaces. ## Examples Input: 5 3 1 4 1 2 Expected Output: 1 1 2 3 4 ...
M14
Perl
11
Solve the following programming problem in Perl. ## Problem: Second Largest Distinct Number Read an integer N ≥ 2 followed by N integers on the next line. Consider the distinct values and output the second largest distinct value. Inputs are guaranteed to contain at least two distinct numbers. ## Examples Input: 4...
M15
Perl
11
Solve the following programming problem in Perl. ## Problem: Anagram Test Read two lowercase strings S1 and S2 (no spaces) on separate lines. Output 'yes' if S1 and S2 contain exactly the same characters with the same multiplicities (anagrams), otherwise output 'no'. ## Examples Input: listen silent Expected Ou...
M16
Perl
11
Solve the following programming problem in Perl. ## Problem: Interleave Two Strings Read two strings S1 and S2 of equal length on separate lines. Construct a new string by alternating characters: S1[0], S2[0], S1[1], S2[1], ... until the end. Output the interleaved string. ## Examples Input: abc XYZ Expected Ou...
M17
Perl
11
Solve the following programming problem in Perl. ## Problem: Replace Spaces With Underscores Read a line of text and output the same string but with every space character replaced by an underscore ('_'). All other characters stay unchanged. ## Examples Input: hello world Expected Output: hello_world Input: a ...
M18
Perl
11
Solve the following programming problem in Perl. ## Problem: Sum Of List Read an integer N followed by a line of N integers separated by spaces. Sum the integers exactly and output the total. ## Examples Input: 4 1 2 3 4 Expected Output: 10 Input: 3 10 -5 -5 Expected Output: 0 ## Requirements - Write a co...
M19
Perl
11
Solve the following programming problem in Perl. ## Problem: Characters At Even Indices Read a string S and output a new string consisting of the characters at even indices (0-based) from S in their original order. ## Examples Input: abcdef Expected Output: ace Input: a Expected Output: a ## Requirements ...
M20
Perl
11
Solve the following programming problem in Perl. ## Problem: Count Distinct Characters Read a string S and output the number of distinct characters present in S. Treat uppercase and lowercase as different characters. ## Examples Input: aaa Expected Output: 1 Input: abca Expected Output: 3 ## Requirements ...
M01
Rust
14
Solve the following programming problem in Rust. ## Problem: Palindrome Check Read a string S and determine whether it reads the same forwards and backwards, comparing characters exactly (case-sensitive and including punctuation). Output 'yes' for palindromes and 'no' otherwise. ## Examples Input: racecar Expec...
M02
Rust
14
Solve the following programming problem in Rust. ## Problem: Word Count Read a line consisting of words separated by single spaces. Count how many words appear (non-empty sequences between spaces) and output that integer. ## Examples Input: hello world Expected Output: 2 Input: one two three Expected Output...
M03
Rust
14
Solve the following programming problem in Rust. ## Problem: Run Length Encoding Read a string S and produce its run-length encoding: for each maximal block of identical characters, output the character followed immediately by the length of the block as a decimal integer. Concatenate all blocks and output the resulti...
M04
Rust
14
Solve the following programming problem in Rust. ## Problem: Caesar Shift By 3 Read a lowercase alphabetic string S. Shift each letter forward by 3 positions in the English alphabet (wrapping z to c) and output the transformed string. Non-letter characters will not appear. ## Examples Input: abc Expected Output...
M05
Rust
14
Solve the following programming problem in Rust. ## Problem: Simple Binary Expression Read an expression formatted as 'a op b' with single spaces, where a and b are integers and op is one of '+', '-', or '*'. Evaluate the expression using integer arithmetic and output the result as an integer. ## Examples Input: ...
M06
Rust
14
Solve the following programming problem in Rust. ## Problem: Greatest Common Divisor Read two integers a and b separated by whitespace. Compute their greatest common divisor as a positive integer and output that value. ## Examples Input: 12 18 Expected Output: 6 Input: 7 5 Expected Output: 1 ## Requirement...
M07
Rust
14
Solve the following programming problem in Rust. ## Problem: Factorial Read an integer N with 0 ≤ N ≤ 10. Compute N! (the factorial) using integer arithmetic and output the result. ## Examples Input: 5 Expected Output: 120 Input: 0 Expected Output: 1 ## Requirements - Write a complete, self-contained prog...
M08
Rust
14
Solve the following programming problem in Rust. ## Problem: Nth Fibonacci Number Read an integer N ≥ 1 and output the Nth Fibonacci number using the 1-indexed sequence with F1 = 1 and F2 = 1. Use arbitrary-precision integers if needed. ## Examples Input: 1 Expected Output: 1 Input: 5 Expected Output: 5 ##...
M09
Rust
14
Solve the following programming problem in Rust. ## Problem: Decimal To Binary Read a non-negative integer N in decimal. Output its binary representation without leading zeros (except print '0' when N = 0). ## Examples Input: 5 Expected Output: 101 Input: 8 Expected Output: 1000 ## Requirements - Write a ...
M10
Rust
14
Solve the following programming problem in Rust. ## Problem: Binary To Decimal Read a string consisting only of characters '0' and '1'. Interpret it as a binary number and output the corresponding decimal integer without extra text. ## Examples Input: 101 Expected Output: 5 Input: 1000 Expected Output: 8 #...
M11
Rust
14
Solve the following programming problem in Rust. ## Problem: Substring Occurrences Read a string S on the first line and a pattern P on the second line. Count how many times P appears in S, allowing overlapping matches, and output that integer count. ## Examples Input: aaaa aa Expected Output: 3 Input: abcabc...
M12
Rust
14
Solve the following programming problem in Rust. ## Problem: Remove Vowels Read a line of text and remove every vowel character (a, e, i, o, u in both uppercase and lowercase). Output the filtered string preserving the order of the remaining characters. ## Examples Input: hello Expected Output: hll Input: Eso...
M13
Rust
14
Solve the following programming problem in Rust. ## Problem: Sort Numbers Read an integer N on the first line followed by a second line containing N integers separated by spaces. Output the integers sorted in ascending order separated by single spaces. ## Examples Input: 5 3 1 4 1 2 Expected Output: 1 1 2 3 4 ...
M14
Rust
14
Solve the following programming problem in Rust. ## Problem: Second Largest Distinct Number Read an integer N ≥ 2 followed by N integers on the next line. Consider the distinct values and output the second largest distinct value. Inputs are guaranteed to contain at least two distinct numbers. ## Examples Input: 4...
M15
Rust
14
Solve the following programming problem in Rust. ## Problem: Anagram Test Read two lowercase strings S1 and S2 (no spaces) on separate lines. Output 'yes' if S1 and S2 contain exactly the same characters with the same multiplicities (anagrams), otherwise output 'no'. ## Examples Input: listen silent Expected Ou...
M16
Rust
14
Solve the following programming problem in Rust. ## Problem: Interleave Two Strings Read two strings S1 and S2 of equal length on separate lines. Construct a new string by alternating characters: S1[0], S2[0], S1[1], S2[1], ... until the end. Output the interleaved string. ## Examples Input: abc XYZ Expected Ou...
M17
Rust
14
Solve the following programming problem in Rust. ## Problem: Replace Spaces With Underscores Read a line of text and output the same string but with every space character replaced by an underscore ('_'). All other characters stay unchanged. ## Examples Input: hello world Expected Output: hello_world Input: a ...
M18
Rust
14
Solve the following programming problem in Rust. ## Problem: Sum Of List Read an integer N followed by a line of N integers separated by spaces. Sum the integers exactly and output the total. ## Examples Input: 4 1 2 3 4 Expected Output: 10 Input: 3 10 -5 -5 Expected Output: 0 ## Requirements - Write a co...
M19
Rust
14
Solve the following programming problem in Rust. ## Problem: Characters At Even Indices Read a string S and output a new string consisting of the characters at even indices (0-based) from S in their original order. ## Examples Input: abcdef Expected Output: ace Input: a Expected Output: a ## Requirements ...
M20
Rust
14
Solve the following programming problem in Rust. ## Problem: Count Distinct Characters Read a string S and output the number of distinct characters present in S. Treat uppercase and lowercase as different characters. ## Examples Input: aaa Expected Output: 1 Input: abca Expected Output: 3 ## Requirements ...
End of preview. Expand in Data Studio

sdc-prompts-medium-v1

Prompts for Medium tier

Dataset Info

  • Rows: 160
  • Columns: 4

Columns

Column Type Description
problem_id Value('string') Problem identifier (M01-M20)
language Value('string') Target programming language
tiobe_rank Value('int64') TIOBE index rank
prompt Value('string') Full prompt text sent to GPT-5.2

Generation Parameters

{
  "script_name": "run_medium_zero_shot.py",
  "model": "gpt-5-2",
  "description": "Prompts for Medium tier",
  "tier": "medium",
  "hyperparameters": {
    "temperature": 0.7,
    "max_tokens": "model_maximum"
  },
  "input_datasets": [
    "Lossfunk/Esolang-Bench"
  ]
}

Experiment Documentation

For complete experiment details, see https://github.com/Zayne-sprague/SC-Research-Notes/tree/main/experiments/semantic-distance-coding

Usage

from datasets import load_dataset

dataset = load_dataset("reasoning-degeneration-dev/sdc-prompts-medium-v1", split="train")
print(f"Loaded {len(dataset)} rows")

This dataset is tracked in reasoning-degeneration-dev/PROJECT-MANIFEST

Downloads last month
26