chosen listlengths 2 2 | rejected listlengths 2 2 |
|---|---|
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nAs a teacher, Riko Hakozaki often needs to help her students with problems from va... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nAs a teacher, Riko Hakozaki often needs to help her students with problems from va... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a sequence of N positive integers A = (A_1, A_2, \\dots ,A_N), where... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a sequence of N positive integers A = (A_1, A_2, \\dots ,A_N), where... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThere are N chits, out of which, A chits have 1 written on them and B (A+B = N) ch... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThere are N chits, out of which, A chits have 1 written on them and B (A+B = N) ch... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nSardar Khan has finally decided to attack Ramadhir - he will bomb one of Ramadhir'... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nSardar Khan has finally decided to attack Ramadhir - he will bomb one of Ramadhir'... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a string $s[1 \\dots n]$ consisting of lowercase Latin letters. It i... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a string $s[1 \\dots n]$ consisting of lowercase Latin letters. It i... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given two strings word1 and word2.\nA string x is called valid if x can be... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given two strings word1 and word2.\nA string x is called valid if x can be... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given an m x n binary matrix grid.\nA row or column is considered palindro... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given an m x n binary matrix grid.\nA row or column is considered palindro... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nRead problems statements in Mandarin Chinese, Russian and Vietnamese as well. \n\n... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nRead problems statements in Mandarin Chinese, Russian and Vietnamese as well. \n\n... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nAlice and Bob are playing a game on a string.\nYou are given a string s, Alice and... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nAlice and Bob are playing a game on a string.\nYou are given a string s, Alice and... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nNothing is eternal in the world, Kostya understood it on the 7-th of January when ... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nNothing is eternal in the world, Kostya understood it on the 7-th of January when ... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nA souvenir shop at AtCoder Land sells N boxes.\nThe boxes are numbered 1 to N, and... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nA souvenir shop at AtCoder Land sells N boxes.\nThe boxes are numbered 1 to N, and... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a horizontally written text. Convert it to vertical writing, filling... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a horizontally written text. Convert it to vertical writing, filling... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nPetya has a string of length n consisting of small and large English letters and d... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nPetya has a string of length n consisting of small and large English letters and d... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nRead problems statements in Mandarin Chinese, Russian and Vietnamese as well. \n\n... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nRead problems statements in Mandarin Chinese, Russian and Vietnamese as well. \n\n... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThe legend of the foundation of Vectorland talks of two integers $x$ and $y$. Cent... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThe legend of the foundation of Vectorland talks of two integers $x$ and $y$. Cent... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThere are N people numbered from 1 to N visiting a conveyor belt sushi restaurant.... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThere are N people numbered from 1 to N visiting a conveyor belt sushi restaurant.... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\n\\documentclass{article}\n\\usepackage{graphicx} % Required for inserting images\n... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\n\\documentclass{article}\n\\usepackage{graphicx} % Required for inserting images\n... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nSardar Khan has finally decided to attack Ramadhir - he will bomb one of Ramadhir'... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nSardar Khan has finally decided to attack Ramadhir - he will bomb one of Ramadhir'... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThere is a grid with H rows and W columns.\r\nLet (i,j) denote the cell at the i-t... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThere is a grid with H rows and W columns.\r\nLet (i,j) denote the cell at the i-t... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nConsider a rooted tree. A rooted tree has one special vertex called the root. All ... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nConsider a rooted tree. A rooted tree has one special vertex called the root. All ... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a tree (a connected undirected graph without cycles) of $n$ vertices... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a tree (a connected undirected graph without cycles) of $n$ vertices... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a sequence of N positive integers A = (A_1, A_2, \\dots ,A_N), where... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a sequence of N positive integers A = (A_1, A_2, \\dots ,A_N), where... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given an array $A$ consisting of $N$ Integers which are initially all $0$.... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given an array $A$ consisting of $N$ Integers which are initially all $0$.... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nDZY loves chemistry, and he enjoys mixing chemicals.\n\nDZY has n chemicals, and m... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nDZY loves chemistry, and he enjoys mixing chemicals.\n\nDZY has n chemicals, and m... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nGiven a positive integer N, find a possible arrangement of the integers from 0 to ... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nGiven a positive integer N, find a possible arrangement of the integers from 0 to ... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThe AtCoder company office can be represented as a grid of H rows and W columns. L... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThe AtCoder company office can be represented as a grid of H rows and W columns. L... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThe black king is standing on a chess field consisting of 10^9 rows and 10^9 colum... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThe black king is standing on a chess field consisting of 10^9 rows and 10^9 colum... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nPasha has a wooden stick of some positive integer length n. He wants to perform ex... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nPasha has a wooden stick of some positive integer length n. He wants to perform ex... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nOkabe and Super Hacker Daru are stacking and removing boxes. There are n boxes num... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nOkabe and Super Hacker Daru are stacking and removing boxes. There are n boxes num... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given 2 arrays $a$ and $b$, both of size $n$. You can swap two elements in... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given 2 arrays $a$ and $b$, both of size $n$. You can swap two elements in... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given an array $a$ consisting of $n$ integers (it is guaranteed that $n$ i... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given an array $a$ consisting of $n$ integers (it is guaranteed that $n$ i... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nPetya got interested in grammar on his third year in school. He invented his own l... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nPetya got interested in grammar on his third year in school. He invented his own l... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nIgor is in the museum and he wants to see as many pictures as possible.\n\nMuseum ... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nIgor is in the museum and he wants to see as many pictures as possible.\n\nMuseum ... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a horizontally written text. Convert it to vertical writing, filling... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a horizontally written text. Convert it to vertical writing, filling... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nAnton is playing a very interesting computer game, but now he is stuck at one of t... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nAnton is playing a very interesting computer game, but now he is stuck at one of t... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a string S consisting of uppercase and lowercase English letters. \... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a string S consisting of uppercase and lowercase English letters. \... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nJanusz is a businessman. He owns a company \"Januszex\", which produces games for ... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nJanusz is a businessman. He owns a company \"Januszex\", which produces games for ... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a horizontally written text. Convert it to vertical writing, filling... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a horizontally written text. Convert it to vertical writing, filling... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nWatson gives a square of side length 1 to Sherlock. Now, after each second, each s... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nWatson gives a square of side length 1 to Sherlock. Now, after each second, each s... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nNatasha is going to fly on a rocket to Mars and return to Earth. Also, on the way ... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nNatasha is going to fly on a rocket to Mars and return to Earth. Also, on the way ... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThere are N+2 cells arranged in a row. Let cell i denote the i-th cell from the le... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThere are N+2 cells arranged in a row. Let cell i denote the i-th cell from the le... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nSasha and Kolya decided to get drunk with Coke, again. This time they have k types... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nSasha and Kolya decided to get drunk with Coke, again. This time they have k types... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given an array $a$ consisting of $n$ integers (it is guaranteed that $n$ i... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given an array $a$ consisting of $n$ integers (it is guaranteed that $n$ i... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given n segments on a line. There are no ends of some segments that coinci... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given n segments on a line. There are no ends of some segments that coinci... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nIahub is training for the IOI. What is a better way to train than playing a Zuma-l... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nIahub is training for the IOI. What is a better way to train than playing a Zuma-l... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThis is the harder version of the problem. In this version, 1 β€ n β€ 10^6 and 0 β€ a... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThis is the harder version of the problem. In this version, 1 β€ n β€ 10^6 and 0 β€ a... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nOkabe and Super Hacker Daru are stacking and removing boxes. There are n boxes num... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nOkabe and Super Hacker Daru are stacking and removing boxes. There are n boxes num... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a horizontally written text. Convert it to vertical writing, filling... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a horizontally written text. Convert it to vertical writing, filling... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nAs a tradition, every year before IOI all the members of Natalia Fan Club are invi... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nAs a tradition, every year before IOI all the members of Natalia Fan Club are invi... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nAs you very well know, this year's funkiest numbers are so called triangular numbe... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nAs you very well know, this year's funkiest numbers are so called triangular numbe... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nIn Ann's favorite book shop are as many as n books on math and economics. Books ar... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nIn Ann's favorite book shop are as many as n books on math and economics. Books ar... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nConnected undirected weighted graph without self-loops and multiple edges is given... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nConnected undirected weighted graph without self-loops and multiple edges is given... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a string $s$ consisting of the characters 0, 1, and ?.\n\nLet's call... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a string $s$ consisting of the characters 0, 1, and ?.\n\nLet's call... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nGiven a string s and an integer k, return the total number of substrings of s wher... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nGiven a string s and an integer k, return the total number of substrings of s wher... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a sequence of integers A = (A_1, A_2, \\ldots, A_N) of length N.\r\n... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a sequence of integers A = (A_1, A_2, \\ldots, A_N) of length N.\r\n... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nWatson gives a square of side length 1 to Sherlock. Now, after each second, each s... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nWatson gives a square of side length 1 to Sherlock. Now, after each second, each s... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nOkabe and Super Hacker Daru are stacking and removing boxes. There are n boxes num... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nOkabe and Super Hacker Daru are stacking and removing boxes. There are n boxes num... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nA company has n employees numbered from 1 to n. Each employee either has no immedi... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nA company has n employees numbered from 1 to n. Each employee either has no immedi... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given two binary square matrices $a$ and $b$ of size $n \\times n$. A matr... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given two binary square matrices $a$ and $b$ of size $n \\times n$. A matr... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou have an array a consisting of n integers. Each integer from 1 to n appears exa... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou have an array a consisting of n integers. Each integer from 1 to n appears exa... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a string S consisting of uppercase and lowercase English letters. \... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a string S consisting of uppercase and lowercase English letters. \... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given an array $A$ consisting of $N$ Integers which are initially all $0$.... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given an array $A$ consisting of $N$ Integers which are initially all $0$.... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nLet quasi-palindromic number be such number that adding some leading zeros (possib... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nLet quasi-palindromic number be such number that adding some leading zeros (possib... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThe legend of the foundation of Vectorland talks of two integers $x$ and $y$. Cent... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThe legend of the foundation of Vectorland talks of two integers $x$ and $y$. Cent... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nEach New Year Timofey and his friends cut down a tree of n vertices and bring it h... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nEach New Year Timofey and his friends cut down a tree of n vertices and bring it h... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given two binary square matrices $a$ and $b$ of size $n \\times n$. A matr... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given two binary square matrices $a$ and $b$ of size $n \\times n$. A matr... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nIn Ciel's restaurant, a waiter is training.\nSince the waiter isn't good at arithm... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nIn Ciel's restaurant, a waiter is training.\nSince the waiter isn't good at arithm... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThe legend of the foundation of Vectorland talks of two integers $x$ and $y$. Cent... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThe legend of the foundation of Vectorland talks of two integers $x$ and $y$. Cent... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nWatson gives a square of side length 1 to Sherlock. Now, after each second, each s... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nWatson gives a square of side length 1 to Sherlock. Now, after each second, each s... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nRead problem statements in [Vietnamese],\n[Bengali], [Mandarin Chinese], and [Russ... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nRead problem statements in [Vietnamese],\n[Bengali], [Mandarin Chinese], and [Russ... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a string s and an integer t, representing the number of transformati... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a string s and an integer t, representing the number of transformati... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given an array of integers start and an integer d, representing n interval... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given an array of integers start and an integer d, representing n interval... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThere are N chits, out of which, A chits have 1 written on them and B (A+B = N) ch... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThere are N chits, out of which, A chits have 1 written on them and B (A+B = N) ch... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThere are N houses at points (X_1,Y_1),\\ldots,(X_N,Y_N) on a two-dimensional plan... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThere are N houses at points (X_1,Y_1),\\ldots,(X_N,Y_N) on a two-dimensional plan... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nRead problems statements in Mandarin Chinese, Russian and Vietnamese as well. \n\n... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nRead problems statements in Mandarin Chinese, Russian and Vietnamese as well. \n\n... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThere are N friends who decided to play the game of musical chairs one day.\n\nIni... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nThere are N friends who decided to play the game of musical chairs one day.\n\nIni... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\n$n$ distinct integers $x_1,x_2,\\ldots,x_n$ are written on the board. Nezzar can p... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\n$n$ distinct integers $x_1,x_2,\\ldots,x_n$ are written on the board. Nezzar can p... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nJust to remind, girls in Arpa's land are really nice.\n\nMehrdad wants to invite s... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nJust to remind, girls in Arpa's land are really nice.\n\nMehrdad wants to invite s... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nAlice and Bob are playing a game on a string.\nYou are given a string s, Alice and... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nAlice and Bob are playing a game on a string.\nYou are given a string s, Alice and... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given two strings word1 and word2.\nA string x is called valid if x can be... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given two strings word1 and word2.\nA string x is called valid if x can be... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given an integer sequence A = (A_1, A_2, \\dots, A_N) of length N.\r\nYou ... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given an integer sequence A = (A_1, A_2, \\dots, A_N) of length N.\r\nYou ... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nMatryoshka is a wooden toy in the form of a painted doll, inside which you can put... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nMatryoshka is a wooden toy in the form of a painted doll, inside which you can put... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou have an array a consisting of n integers. Each integer from 1 to n appears exa... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou have an array a consisting of n integers. Each integer from 1 to n appears exa... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given two strings word1 and word2.\nA string x is called valid if x can be... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given two strings word1 and word2.\nA string x is called valid if x can be... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nA competition consists of n players numbered from 0 to n - 1.\nYou are given an in... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nA competition consists of n players numbered from 0 to n - 1.\nYou are given an in... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a string s and an integer t, representing the number of transformati... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a string s and an integer t, representing the number of transformati... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nA permutation of length $n$ is an array consisting of $n$ distinct integers from $... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nA permutation of length $n$ is an array consisting of $n$ distinct integers from $... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a sequence of N positive integers A = (A_1, A_2, \\dots ,A_N), where... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a sequence of N positive integers A = (A_1, A_2, \\dots ,A_N), where... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nJon fought bravely to rescue the wildlings who were attacked by the white-walkers ... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nJon fought bravely to rescue the wildlings who were attacked by the white-walkers ... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nRead problem statements in [Hindi], [Bengali], [Mandarin Chinese], [Russian], and ... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nRead problem statements in [Hindi], [Bengali], [Mandarin Chinese], [Russian], and ... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nSometimes it is not easy to come to an agreement in a bargain. Right now Sasha and... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nSometimes it is not easy to come to an agreement in a bargain. Right now Sasha and... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given an integer array nums of length n.\nYour goal is to start at index 0... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given an integer array nums of length n.\nYour goal is to start at index 0... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a sequence A of length N.\r\nFreely choose exactly K elements from A... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a sequence A of length N.\r\nFreely choose exactly K elements from A... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a string S of length N. You are also given Q queries, which you shou... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nYou are given a string S of length N. You are also given Q queries, which you shou... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nIn the Kingdom of AtCoder, residents are required to shout their love for takoyaki... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nIn the Kingdom of AtCoder, residents are required to shout their love for takoyaki... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nAs a teacher, Riko Hakozaki often needs to help her students with problems from va... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nAs a teacher, Riko Hakozaki often needs to help her students with problems from va... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nRead problem statements in [Vietnamese],\n[Bengali], [Mandarin Chinese], and [Russ... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nRead problem statements in [Vietnamese],\n[Bengali], [Mandarin Chinese], and [Russ... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nDZY loves chemistry, and he enjoys mixing chemicals.\n\nDZY has n chemicals, and m... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nDZY loves chemistry, and he enjoys mixing chemicals.\n\nDZY has n chemicals, and m... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nLittle penguin Polo has an n Γ m matrix, consisting of integers. Let's index the m... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nLittle penguin Polo has an n Γ m matrix, consisting of integers. Let's index the m... |
[
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nRead problems statements in Mandarin Chinese and Russian. \n\nTuzik and his maste... | [
{
"content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.\n\nQuestion:\nRead problems statements in Mandarin Chinese and Russian. \n\nTuzik and his maste... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.