Dataset Viewer
Auto-converted to Parquet Duplicate
rating
int64
800
3.5k
tags
listlengths
0
11
official_tests
listlengths
1
150
prompt
stringlengths
1.11k
5.74k
800
[ "math", "number theory" ]
[ { "input": "6\r\n1 2\r\n1 10\r\n49 49\r\n69 420\r\n1 1\r\n9982 44353\r\n", "output": "1\r\n9\r\n0\r\n351\r\n1\r\n34371\r\n" } ]
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3. Your solution must read input from sta...
1,100
[ "constructive algorithms", "data structures", "greedy", "sortings" ]
[ { "input": "6\r\n2 1 1\r\n2 1\r\n3 2 3\r\n1 2 3\r\n3 1 3\r\n3 1 2\r\n4 2 3\r\n1 2 2 2\r\n5 2 5\r\n3 3 2 3 5\r\n6 1 3\r\n3 6 6 4 3 2\r\n", "output": "1\r\n3\r\n6\r\n3\r\n11\r\n8\r\n" } ]
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3. Your solution must read input from sta...
1,600
[ "brute force", "data structures", "dfs and similar", "dp", "graphs", "greedy", "sortings", "trees" ]
[ { "input": "3\r\n2\r\n1 2\r\n4\r\n1 2\r\n2 3\r\n2 4\r\n7\r\n1 2\r\n1 3\r\n2 4\r\n4 5\r\n5 6\r\n5 7\r\n", "output": "0\r\n2\r\n4\r\n" }, { "input": "1\r\n22\r\n1 2\r\n3 4\r\n5 6\r\n7 8\r\n9 10\r\n11 12\r\n13 14\r\n15 16\r\n17 2\r\n17 4\r\n17 6\r\n17 8\r\n18 10\r\n18 12\r\n18 14\r\n18 16\r\n17 19\r\n1...
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3. Your solution must read input from sta...
2,000
[ "binary search", "brute force", "data structures", "geometry", "greedy", "implementation", "math", "ternary search", "two pointers" ]
[ { "input": "5\r\n1 3\r\n0\r\n0 1 -1\r\n2 4\r\n0 100\r\n-100 -50 0 50\r\n2 4\r\n0 1000\r\n-100 -50 0 50\r\n6 6\r\n20 1 27 100 43 42\r\n100 84 1 24 22 77\r\n8 2\r\n564040265 -509489796 469913620 198872582 -400714529 553177666 131159391 -20796763\r\n-1000000000 1000000000\r\n", "output": "1\r\n2\r\n2\r\n150 20...
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3. Your solution must read input from sta...
2,300
[ "data structures", "dfs and similar", "dp", "greedy", "trees" ]
[ { "input": "4\r\n3\r\n1 2\r\n1 3\r\n3\r\n1 2\r\n3 2\r\n5\r\n2 3\r\n1 5\r\n4 2\r\n1 2\r\n11\r\n2 1\r\n2 3\r\n2 4\r\n4 5\r\n6 5\r\n5 7\r\n4 8\r\n8 9\r\n7 10\r\n10 11\r\n", "output": "1\r\n0\r\n4\r\n29\r\n" } ]
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3. Your solution must read input from sta...
2,400
[ "combinatorics", "data structures", "dfs and similar", "dp", "dsu", "graphs", "hashing", "implementation", "math", "trees" ]
[ { "input": "3\r\n3\r\n2 5\r\n1 6\r\n3 4\r\n4\r\n1 6\r\n7 8\r\n2 3\r\n4 5\r\n6\r\n2 3\r\n1 6\r\n7 8\r\n9 12\r\n10 11\r\n4 5\r\n", "output": "5 1 1 1\r\n14 2 2 1 1\r\n132 42 5 2 1 1 1\r\n" } ]
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3. Your solution must read input from sta...
2,700
[ "combinatorics", "data structures", "dfs and similar", "dsu", "graphs", "implementation", "trees" ]
[ { "input": "3\r\n3\r\n2 5\r\n1 6\r\n3 4\r\n4\r\n1 6\r\n7 8\r\n2 3\r\n4 5\r\n6\r\n2 3\r\n1 6\r\n7 8\r\n9 12\r\n10 11\r\n4 5\r\n", "output": "5 1 1 1\r\n14 2 2 1 1\r\n132 42 5 2 1 1 1\r\n" } ]
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3. Your solution must read input from sta...
900
[ "brute force", "implementation", "math" ]
[ { "input": "6\r\n2 2 2\r\nNE\r\n3 2 2\r\nNNE\r\n6 2 1\r\nNNEESW\r\n6 10 10\r\nNNEESW\r\n3 4 2\r\nNEE\r\n4 5 5\r\nNEWS\r\n", "output": "YES\r\nNO\r\nYES\r\nYES\r\nYES\r\nNO\r\n" } ]
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3. Your solution must read input from sta...
1,400
[ "binary search", "implementation", "math" ]
[ { "input": "7\r\n10 1 0\r\n1 2 3\r\n100 2 1\r\n3 0 1\r\n3 0 0\r\n1000000000000000000 0 0\r\n1000000000000000000 1000000000000000000 1000000000000000000\r\n", "output": "0\r\n1\r\n50\r\n2\r\n-1\r\n-1\r\n1000000000000000000\r\n" }, { "input": "5\r\n1000000000000000000 0 1000000000000000000\r\n10000000...
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3. Your solution must read input from sta...
1,600
[ "binary search", "dp", "greedy", "two pointers" ]
[ { "input": "7\r\n6 2 1\r\n1 1 10 1 1 10\r\n6 2 2\r\n1 1 10 1 1 10\r\n6 2 3\r\n1 1 10 1 1 10\r\n6 2 10\r\n1 1 10 1 1 10\r\n6 2 11\r\n1 1 10 1 1 10\r\n6 2 12\r\n1 1 10 1 1 10\r\n6 2 12\r\n1 1 1 1 10 10\r\n", "output": "22\r\n12\r\n2\r\n2\r\n2\r\n0\r\n-1\r\n" }, { "input": "1\r\n10 4 75\r\n44 29 42 44 ...
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3. Your solution must read input from sta...
2,000
[ "constructive algorithms", "data structures", "dp", "graphs", "greedy", "implementation", "ternary search" ]
[ { "input": "2\r\n3\r\n1 3 2\r\n2 1 3\r\n1 2 3\r\n4\r\n2 3 1 4\r\n1 2 3 4\r\n1 4 2 3\r\n", "output": "YES\r\n2\r\nk 2\r\nq 3\r\nNO\r\n" }, { "input": "2\r\n2\r\n1 2\r\n1 2\r\n1 2\r\n2\r\n1 2\r\n1 2\r\n2 1\r\n", "output": "NO\r\nYES\r\n1\r\nj 2\r\n" }, { "input": "1\r\n5\r\n3 2 4 1 5\r\n1 ...
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3. Your solution must read input from sta...
2,300
[ "combinatorics", "dfs and similar", "dp", "games", "greedy", "math", "probabilities", "trees" ]
[ { "input": "2\r\n5\r\n1 2\r\n1 3\r\n2 4\r\n3 5\r\n9\r\n1 2\r\n2 3\r\n4 5\r\n5 6\r\n7 8\r\n8 9\r\n2 4\r\n5 7\r\n", "output": "1 499122177 499122177 0 0 \r\n1 499122177 0 332748118 166374059 0 443664157 720954255 0 \r\n" } ]
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3. Your solution must read input from sta...
2,700
[ "bitmasks", "brute force", "dp", "implementation" ]
[ { "input": "6\r\n5 4\r\n2 1 1 1 2\r\n5 5\r\n2 1 1 1 2\r\n5 6\r\n2 1 1 1 2\r\n5 7\r\n2 1 1 1 2\r\n5 8\r\n2 1 1 1 2\r\n5 6\r\n2 0 2 2 3\r\n", "output": "YES\r\nYES\r\nYES\r\nYES\r\nNO\r\nYES\r\n" }, { "input": "5\r\n1 1\r\n0\r\n1 1\r\n1\r\n1 1\r\n2\r\n1 1\r\n3\r\n1 1\r\n4\r\n", "output": "NO\r\nYE...
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3. Your solution must read input from sta...
800
[ "brute force", "dp", "greedy" ]
[ { "input": "4\r\n3\r\n5 4 5\r\n3\r\n4 5 4\r\n10\r\n3 3 3 3 4 1 2 3 4 5\r\n9\r\n17 89 92 42 29 92 14 70 45\r\n", "output": "7\r\n6\r\n10\r\n97\r\n" } ]
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3. Your solution must read input from sta...
1,200
[ "implementation", "math" ]
[ { "input": "3\r\n2 2\r\n101 200\r\n2 1\r\n6 15\r\n1 2 3 5 6 7\r\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\r\n5 8\r\n254618033 265675151 461318786 557391198 848083778\r\n6 9 15 10 6 9 4 4294967300\r\n", "output": "0 100 \r\n0 0 0 0 2 0 0 0 3 0 2 0 0 0 0 \r\n291716045 0 0 0 291716045 0 301749698 0 \r\n" } ]
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3. Your solution must read input from sta...
800
[ "constructive algorithms", "implementation", "math" ]
[ { "input": "4\r\n10 10 1\r\n0 0 3\r\n-5 -8 8\r\n4 -5 3\r\n", "output": "10 10\r\n1 0\r\n-1 0\r\n0 0\r\n-4 -8\r\n-6 -8\r\n-3 -8\r\n-7 -8\r\n-2 -8\r\n-8 -8\r\n-1 -8\r\n-9 -8\r\n5 -5\r\n3 -5\r\n4 -5\r\n" }, { "input": "30\r\n-84 -60 1\r\n-41 -100 2\r\n8 -8 3\r\n-52 -62 4\r\n-61 -76 5\r\n-52 -52 6\r\n14...
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3. Your solution must read input from sta...
1,000
[ "constructive algorithms", "math", "number theory" ]
[ { "input": "3\r\n2\r\n1 2\r\n5\r\n1 2 3 4 5\r\n7\r\n4 7 5 1 2 6 3\r\n", "output": "2 1 \r\n2 3 4 5 1 \r\n7 5 1 2 6 3 4 \r\n" } ]
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3. Your solution must read input from sta...
1,900
[ "binary search", "brute force", "constructive algorithms", "greedy", "implementation" ]
[ { "input": "8\r\n2 10\r\n3 3\r\n1 1\r\n3 10\r\n3 3 3\r\n0 0 0\r\n4 4\r\n2 1 5 1\r\n0 1 0 1\r\n5 4\r\n7 5 2 5 4\r\n0 0 1 0 1\r\n5 1\r\n5 15 15 2 11\r\n1 0 0 1 1\r\n5 2\r\n10 11 4 10 15\r\n1 1 0 1 0\r\n4 4\r\n1 1 2 5\r\n1 1 0 0\r\n2 1000000000\r\n1000000000 1000000000\r\n1 1\r\n", "output": "16\r\n6\r\n8\r\n1...
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3. Your solution must read input from sta...
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
11