text stringlengths 1.5k 150k |
|---|
Write a solution for the following programming challenge. Provide a brief explanation of your approach, followed by the complete code.
User: You are given three sequences: $a_1, a_2, \ldots, a_n$; $b_1, b_2, \ldots, b_n$; $c_1, c_2, \ldots, c_n$.
For each $i$, $a_i \neq b_i$, $a_i \neq c_i$, $b_i \neq c_i$.
Find a s... |
Write a solution for the following programming challenge. Provide a brief explanation of your approach, followed by the complete code.
User: You have $n$ barrels lined up in a row, numbered from left to right from one. Initially, the $i$-th barrel contains $a_i$ liters of water.
You can pour water from one barrel to ... |
Write a solution for the following programming challenge. Provide a brief explanation of your approach, followed by the complete code.
User: You are given a permutation $p=[p_1, p_2, \ldots, p_n]$ of integers from $1$ to $n$. Let's call the number $m$ ($1 \le m \le n$) beautiful, if there exists two indices $l, r$ ($1... |
"Write a solution for the following programming challenge. Provide a brief explanation of your appro(...TRUNCATED) |
"Write a solution for the following programming challenge. Provide a brief explanation of your appro(...TRUNCATED) |
"Write a solution for the following programming challenge. Provide a brief explanation of your appro(...TRUNCATED) |
"Write a solution for the following programming challenge. Provide a brief explanation of your appro(...TRUNCATED) |
"Write a solution for the following programming challenge. Provide a brief explanation of your appro(...TRUNCATED) |
"Write a solution for the following programming challenge. Provide a brief explanation of your appro(...TRUNCATED) |
"Write a solution for the following programming challenge. Provide a brief explanation of your appro(...TRUNCATED) |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 59