id stringlengths 11 46 | question stringlengths 828 4.77k | question_title stringlengths 11 48 | platform stringclasses 1
value | difficulty stringclasses 9
values | contest_date stringclasses 1
value | starter_code stringclasses 1
value | public_test_cases stringlengths 71 679 | private_test_cases stringlengths 2 4.73M | metadata stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|
1569_C._Jury_Meeting | You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
Question:
n people gathered to hold a jury meeting of the upcoming competition, the i-th member of the jury came up with a_i tasks, which they want to share with each oth... | 1569_C. Jury Meeting | codeforces | C | [{"input": "4\n2\n1 2\n3\n5 5 5\n4\n1 3 3 7\n6\n3 4 2 1 3 3\n", "output": "1\n6\n0\n540\n", "testtype": "stdin"}] | [{"input": "1\n3\n11 11 154\n", "output": "0\n", "testtype": "stdin"}, {"input": "1\n74\n9 3 10 8 6 6 1 6 9 3 7 3 2 8 1 5 8 4 6 4 1 6 5 6 10 3 6 6 6 4 9 5 8 7 2 1 6 2 4 9 10 9 5 4 7 5 7 2 10 10 1 5 2 4 1 7 7 3 8 10 2 5 8 4 3 9 2 9 9 8 6 8 4 1\n", "output": "420779088\n", "testtype": "stdin"}] | {} | ||
1569_D._Inconvenient_Pairs | You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
Question:
There is a city that can be represented as a square grid with corner points in (0, 0) and (10^6, 10^6).
The city has n vertical and m horizontal streets that g... | 1569_D. Inconvenient Pairs | codeforces | D | [{"input": "2\n2 2 4\n0 1000000\n0 1000000\n1 0\n1000000 1\n999999 1000000\n0 999999\n5 4 9\n0 1 2 6 1000000\n0 4 8 1000000\n4 4\n2 5\n2 2\n6 3\n1000000 1\n3 8\n5 8\n8 8\n6 8\n", "output": "2\n5\n", "testtype": "stdin"}] | [{"input": "1\n2 2 2\n0 1000000\n0 1000000\n1556 1000000\n0 34\n", "output": "0\n", "testtype": "stdin"}] | {} | ||
1569_E._Playoff_Restoration | You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
Question:
2^k teams participate in a playoff tournament. The tournament consists of 2^k - 1 games. They are held as follows: first of all, the teams are split into pairs:... | 1569_E. Playoff Restoration | codeforces | E | [{"input": "3 1337 75275197\n", "output": "5 3 5 2 1 5 5 3 \n", "testtype": "stdin"}, {"input": "2 100 7020100\n", "output": "-1\n", "testtype": "stdin"}, {"input": "2 100 5040100\n", "output": "1 3 3 2 \n", "testtype": "stdin"}] | [{"input": "5 152163 673838731\n", "output": "17 5 9 17 3 17 17 9 17 9 17 5 1 17 17 9 17 5 9 17 9 17 17 2 3 17 9 17 5 17 9 17 \n", "testtype": "stdin"}, {"input": "5 456 904943609\n", "output": "17 3 17 9 17 5 17 9 17 1 17 9 17 5 17 9 5 17 17 9 17 2 9 17 3 17 9 17 5 17 9 17 ", "testtype": "stdin"}, {"input": "5 123 393... | {} | ||
1569_F._Palindromic_Hamiltonian_Path | You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
Question:
You are given a simple undirected graph with n vertices, n is even. You are going to write a letter on each vertex. Each letter should be one of the first k let... | 1569_F. Palindromic Hamiltonian Path | codeforces | F | [{"input": "4 6 3\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4\n", "output": "21\n", "testtype": "stdin"}, {"input": "4 3 3\n1 2\n2 3\n3 4\n", "output": "9\n", "testtype": "stdin"}, {"input": "12 19 12\n1 3\n2 6\n3 6\n3 7\n4 8\n8 5\n8 7\n9 4\n5 9\n10 1\n10 4\n10 6\n9 10\n11 1\n5 11\n7 11\n12 2\n12 5\n12 11\n", "output": " ... | [{"input": "6 14 4\n2 5\n1 5\n2 3\n6 2\n2 1\n6 1\n3 1\n6 3\n6 4\n4 3\n3 5\n2 4\n5 4\n5 6\n", "output": "544\n", "testtype": "stdin"}, {"input": "8 6 3\n5 1\n5 4\n6 7\n4 3\n3 5\n3 2\n", "output": "0\n", "testtype": "stdin"}, {"input": "8 26 3\n6 4\n2 8\n8 4\n3 4\n5 6\n5 2\n1 7\n8 1\n3 7\n4 1\n6 1\n5 4\n7 2\n4 7\n6 2\n7 ... | {} | ||
1572_B._Xor_of_3 | You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
Question:
You are given a sequence a of length n consisting of 0s and 1s.
You can perform the following operation on this sequence:
* Pick an index i from 1 to n-2 (... | 1572_B. Xor of 3 | codeforces | B | [{"input": "3\n3\n0 0 0\n5\n1 1 1 1 0\n4\n1 0 0 1\n", "output": "YES\n0\n\nYES\n2\n3 1 \nNO\n", "testtype": "stdin"}] | [{"input": "3\n3\n0 0 0\n5\n1 1 1 1 0\n4\n1 0 0 1\n", "output": "YES\n0\n\nYES\n2\n3 1 \nNO\n", "testtype": "stdin"}] | {} | ||
1572_C._Paint | You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
Question:
You are given a 1 by n pixel image. The i-th pixel of the image has color a_i. For each color, the number of pixels of that color is at most 20.
You can perfor... | 1572_C. Paint | codeforces | C | [{"input": "3\n5\n1 2 3 2 1\n4\n1 1 2 2\n5\n1 2 1 4 2\n", "output": "2\n1\n3\n", "testtype": "stdin"}] | [] | {} | ||
1572_D._Bridge_Club | You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
Question:
There are currently n hot topics numbered from 0 to n-1 at your local bridge club and 2^n players numbered from 0 to 2^n-1. Each player holds a different set of... | 1572_D. Bridge Club | codeforces | D | [{"input": "3 2\n1 9 1 5 7 8 1 1\n", "output": "29", "testtype": "stdin"}, {"input": "2 3\n7 4 5 7\n", "output": "23", "testtype": "stdin"}, {"input": "3 1\n8 3 5 7 1 10 3 2\n", "output": "13", "testtype": "stdin"}] | [{"input": "1 167\n1658 94523\n", "output": "96181", "testtype": "stdin"}] | {} | ||
1572_E._Polygon | You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
Question:
You are given a strictly convex polygon with n vertices.
You will make k cuts that meet the following conditions:
* each cut is a segment that connects two... | 1572_E. Polygon | codeforces | E | [{"input": "6 3\n2 -2\n2 -1\n1 2\n0 2\n-2 1\n-1 0\n", "output": "3\n", "testtype": "stdin"}, {"input": "8 4\n-2 -4\n2 -2\n4 2\n1 5\n0 5\n-4 4\n-5 0\n-5 -1\n", "output": "11\n", "testtype": "stdin"}] | [{"input": "14 3\n17992790 1709180\n25099384 5157649\n29879594 8731582\n36293224 13557705\n38631234 16081528\n41744662 22087452\n42599375 24120293\n39168074 26232405\n34965872 26002177\n18128668 20399649\n11911793 15880552\n5767585 10161426\n7251691 6304422\n13713246 2357090\n", "output": "230155322214397\n", "testtype... | {} | ||
1572_F._Stations | You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
Question:
There are n cities in a row numbered from 1 to n.
The cities will be building broadcasting stations. The station in the i-th city has height h_i and range w_i.... | 1572_F. Stations | codeforces | F | [{"input": "5 10\n1 3 4\n2 3 5\n1 1 5\n2 1 5\n1 4 5\n2 2 4\n1 2 3\n2 1 3\n1 5 5\n2 2 5\n", "output": "4\n10\n5\n4\n5\n", "testtype": "stdin"}, {"input": "1 3\n2 1 1\n1 1 1\n2 1 1\n", "output": "1\n1\n", "testtype": "stdin"}] | [] | {} | ||
1573_A._Countdown | You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
Question:
You are given a digital clock with n digits. Each digit shows an integer from 0 to 9, so the whole clock shows an integer from 0 to 10^n-1. The clock will show ... | 1573_A. Countdown | codeforces | A | [{"input": "7\n3\n007\n4\n1000\n5\n00000\n3\n103\n4\n2020\n9\n123456789\n30\n001678294039710047203946100020\n", "output": "7\n2\n0\n5\n6\n53\n115\n", "testtype": "stdin"}] | [] | {} | ||
1573_C._Book | You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
Question:
You are given a book with n chapters.
Each chapter has a specified list of other chapters that need to be understood in order to understand this chapter. To un... | 1573_C. Book | codeforces | C | [{"input": "5\n4\n1 2\n0\n2 1 4\n1 2\n5\n1 5\n1 1\n1 2\n1 3\n1 4\n5\n0\n0\n2 1 2\n1 2\n2 2 1\n4\n2 2 3\n0\n0\n2 3 2\n5\n1 2\n1 3\n1 4\n1 5\n0\n", "output": "2\n-1\n1\n2\n5\n", "testtype": "stdin"}] | [] | {} | ||
1574_A._Regular_Bracket_Sequences | You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
Question:
A bracket sequence is a string containing only characters "(" and ")". A regular bracket sequence is a bracket sequence that can be transformed into a correct a... | 1574_A. Regular Bracket Sequences | codeforces | A | [{"input": "3\n3\n1\n3\n", "output": "()()()\n(())()\n((()))\n()\n()()()\n(())()\n((()))\n", "testtype": "stdin"}] | [{"input": "50\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n", "output": "()\n()()\n(())\n()()()\n(())()\n((()))\n()()()()\n(())()()\n((()))()\n(((())))\n()()()()()\n(())()(... | {} | ||
1574_B._Combinatorics_Homework | You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
Question:
You are given four integer values a, b, c and m.
Check if there exists a string that contains:
* a letters 'A';
* b letters 'B';
* c letters 'C';
... | 1574_B. Combinatorics Homework | codeforces | B | [{"input": "3\n2 2 1 0\n1 1 1 1\n1 2 3 2\n", "output": "YES\nNO\nYES\n", "testtype": "stdin"}] | [{"input": "1\n1 2 2 114514\n", "output": "NO\n", "testtype": "stdin"}, {"input": "1\n1 1 1 1919810\n", "output": "NO\n", "testtype": "stdin"}, {"input": "1\n1 1 1 46\n", "output": "NO\n", "testtype": "stdin"}, {"input": "1\n114514 1 1 1919810\n", "output": "NO\n", "testtype": "stdin"}, {"input": "2\n23 1 2 1\n1 1 1 46... | {} | ||
1574_C._Slay_the_Dragon | You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
Question:
Recently, Petya learned about a new game "Slay the Dragon". As the name suggests, the player will have to fight with dragons. To defeat a dragon, you have to ki... | 1574_C. Slay the Dragon | codeforces | C | [{"input": "4\n3 6 2 3\n5\n3 12\n7 9\n4 14\n1 10\n8 7\n", "output": "1\n2\n4\n0\n2\n", "testtype": "stdin"}] | [] | {} | ||
1574_D._The_Strongest_Build | You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
Question:
Ivan is playing yet another roguelike computer game. He controls a single hero in the game. The hero has n equipment slots. There is a list of c_i items for the... | 1574_D. The Strongest Build | codeforces | D | [{"input": "3\n3 1 2 3\n2 1 5\n3 2 4 6\n2\n3 2 3\n2 2 3\n", "output": "3 2 2\n", "testtype": "stdin"}, {"input": "3\n3 1 2 3\n2 1 5\n3 2 4 6\n2\n3 2 3\n3 2 2\n", "output": "2 2 3\n", "testtype": "stdin"}, {"input": "4\n1 10\n1 4\n1 7\n1 3\n0\n", "output": "1 1 1 1\n", "testtype": "stdin"}, {"input": "3\n3 1 2 3\n2 1 5\... | [{"input": "10\n3 109 110 111\n2 1 109\n2 1 108\n2 1 107\n2 1 106\n2 1 105\n2 1 104\n2 1 103\n2 1 102\n2 1 101\n2\n3 2 2 2 2 2 2 2 2 2\n2 2 2 2 2 2 2 2 2 2\n", "output": "1 2 2 2 2 2 2 2 2 2\n", "testtype": "stdin"}, {"input": "3\n3 1 2 3\n3 1 2 3\n3 1 2 3\n21\n2 2 1\n3 3 1\n2 3 1\n3 2 1\n3 1 1\n3 1 3\n2 2 2\n3 2 3\n3 ... | {} | ||
1574_E._Coloring | You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
Question:
A matrix of size n × m, such that each cell of it contains either 0 or 1, is considered beautiful if the sum in every contiguous submatrix of size 2 × 2 is exac... | 1574_E. Coloring | codeforces | E | [{"input": "2 2 7\n1 1 1\n1 2 1\n2 1 1\n1 1 0\n1 2 -1\n2 1 -1\n1 1 -1\n", "output": "3\n1\n0\n1\n2\n3\n6\n", "testtype": "stdin"}] | [{"input": "22194 20188 1\n1 1 -1\n", "output": "998244352\n", "testtype": "stdin"}] | {} | ||
1574_F._Occurrences | You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
Question:
A subarray of array a from index l to the index r is the array [a_l, a_{l+1}, ..., a_{r}]. The number of occurrences of the array b in the array a is the number... | 1574_F. Occurrences | codeforces | F | [{"input": "2 4 3\n2 1 2\n3 3 2 1\n", "output": "0\n", "testtype": "stdin"}, {"input": "2 4 3\n2 1 2\n1 3\n", "output": "5\n", "testtype": "stdin"}, {"input": "1 42 1337\n2 13 31\n", "output": "721234447\n", "testtype": "stdin"}] | [{"input": "2 3 3\n2 1 2\n2 2 1\n", "output": "1\n", "testtype": "stdin"}, {"input": "3 100 5\n2 2 3\n2 3 4\n2 1 3\n", "output": "1\n", "testtype": "stdin"}, {"input": "3 5 3\n2 1 2\n2 2 3\n2 3 1\n", "output": "0\n", "testtype": "stdin"}, {"input": "2 4 4\n3 1 2 3\n2 4 3\n", "output": "0\n", "testtype": "stdin"}, {"inp... | {} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.