AReaL-boba-2
Collection
AReaL-boba-2
•
6 items
•
Updated
•
4
prompt
stringlengths 1k
4.56k
| question
stringlengths 449
3.95k
| query_id
stringlengths 46
46
| starter_code
stringlengths 0
142
| input_output
stringlengths 147
161M
| task
stringclasses 1
value | language
stringclasses 1
value |
---|---|---|---|---|---|---|
<|User|>You are an expert Python programmer. 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 three cards with letters $\texttt{a}$, $\texttt{b}$, $\texttt{c}$ placed in a row in some order. You can do the following operation at most once:
- Pick two cards, and swap them. Is it possible that the row becomes $\texttt{abc}$ after the operation? Output "YES" if it is possible, and "NO" otherwise.
Input
The first line contains a single integer $t$ ($1 \leq t \leq 6$) — the number of test cases.
The only line of each test case contains a single string consisting of each of the three characters $\texttt{a}$, $\texttt{b}$, and $\texttt{c}$ exactly once, representing the cards.
Output
For each test case, output "YES" if you can make the row $\texttt{abc}$ with at most one operation, or "NO" otherwise.
You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).Sample Input 1:
6
abc
acb
bac
bca
cab
cba
Sample Output 1:
YES
YES
YES
NO
NO
YES
Note
In the first test case, we don't need to do any operations, since the row is already $\texttt{abc}$.
In the second test case, we can swap $\texttt{c}$ and $\texttt{b}$: $\texttt{acb} \to \texttt{abc}$.
In the third test case, we can swap $\texttt{b}$ and $\texttt{a}$: $\texttt{bac} \to \texttt{abc}$.
In the fourth test case, it is impossible to make $\texttt{abc}$ using at most one operation.
### Format: Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within delimiters as follows. Ensure that when the python program runs, it reads the inputs, runs the algorithm and writes output to STDOUT.
```python
# YOUR CODE HERE
```
### Answer: (use the provided format with backticks)
<|Assistant|><think>
|
There are three cards with letters $\texttt{a}$, $\texttt{b}$, $\texttt{c}$ placed in a row in some order. You can do the following operation at most once:
- Pick two cards, and swap them. Is it possible that the row becomes $\texttt{abc}$ after the operation? Output "YES" if it is possible, and "NO" otherwise.
Input
The first line contains a single integer $t$ ($1 \leq t \leq 6$) — the number of test cases.
The only line of each test case contains a single string consisting of each of the three characters $\texttt{a}$, $\texttt{b}$, and $\texttt{c}$ exactly once, representing the cards.
Output
For each test case, output "YES" if you can make the row $\texttt{abc}$ with at most one operation, or "NO" otherwise.
You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).Sample Input 1:
6
abc
acb
bac
bca
cab
cba
Sample Output 1:
YES
YES
YES
NO
NO
YES
Note
In the first test case, we don't need to do any operations, since the row is already $\texttt{abc}$.
In the second test case, we can swap $\texttt{c}$ and $\texttt{b}$: $\texttt{acb} \to \texttt{abc}$.
In the third test case, we can swap $\texttt{b}$ and $\texttt{a}$: $\texttt{bac} \to \texttt{abc}$.
In the fourth test case, it is impossible to make $\texttt{abc}$ using at most one operation.
|
deepcoder_lcb_24dc38edc3338680bb7ff9d4e2983cd8
|
{"inputs": ["6\nabc\nacb\nbac\nbca\ncab\ncba\n", "1\nabc\n", "3\nabc\nabc\nabc\n", "5\ncab\nacb\ncba\nbac\nbca\n", "6\nabc\nabc\nabc\nabc\nabc\nabc\n"], "outputs": ["YES\nYES\nYES\nNO\nNO\nYES\n", "YES\n", "YES\nYES\nYES\n", "NO\nYES\nYES\nYES\nNO\n", "YES\nYES\nYES\nYES\nYES\nYES\n"], "remote": false}
|
code
|
PYTHON
|
|
"<|User|>You are an expert Python programmer. You will be given a question (problem specificatio(...TRUNCATED) | "Slavic is preparing a present for a friend's birthday. He has an array $a$ of $n$ digits and the pr(...TRUNCATED) |
deepcoder_lcb_89f0f703e934b4e3e21e26e0c83fd87b
| "{\"inputs\": [\"4\\n4\\n2 2 1 2\\n3\\n0 1 2\\n5\\n4 3 2 3 4\\n9\\n9 9 9 9 9 9 9 9 9\\n\", \"1\\n2\\(...TRUNCATED) |
code
|
PYTHON
|
|
"<|User|>You are an expert Python programmer. You will be given a question (problem specificatio(...TRUNCATED) | "You are given a strip of paper $s$ that is $n$ cells long. Each cell is either black or white. In a(...TRUNCATED) |
deepcoder_lcb_f927cde4158d0c93a45eb2be32e3c381
| "{\"inputs\": [\"8\\n6 3\\nWBWWWB\\n7 3\\nWWBWBWW\\n5 4\\nBWBWB\\n5 5\\nBBBBB\\n8 2\\nBWBWBBBB\\n10 (...TRUNCATED) |
code
|
PYTHON
|
|
"<|User|>You are an expert Python programmer. You will be given a question (problem specificatio(...TRUNCATED) | "You are given an array of integers $a_1, a_2, \\ldots, a_n$ and a number $k$ ($2 \\leq k \\leq 5$).(...TRUNCATED) |
deepcoder_lcb_5fbd6ca2766cb9157631d1d68177ab56
| "{\"inputs\": [\"15\\n2 5\\n7 3\\n3 3\\n7 4 1\\n5 2\\n9 7 7 3 9\\n5 5\\n5 4 1 2 3\\n7 4\\n9 5 1 5 9 (...TRUNCATED) |
code
|
PYTHON
|
|
"<|User|>You are an expert Python programmer. You will be given a question (problem specificatio(...TRUNCATED) | "Vanya and Vova are playing a game. Players are given an integer $n$. On their turn, the player can (...TRUNCATED) |
deepcoder_lcb_6fc87f346ed83f41ab5d44b1b3f40b51
| "{\"inputs\": [\"6\\n1\\n3\\n5\\n100\\n999\\n1000\\n\", \"1\\n2\\n\", \"1\\n994\\n\", \"1\\n12\\n\",(...TRUNCATED) |
code
|
PYTHON
|
|
"<|User|>You are an expert Python programmer. You will be given a question (problem specificatio(...TRUNCATED) | "Alex is participating in the filming of another video of BrMeast, and BrMeast asked Alex to prepare(...TRUNCATED) |
deepcoder_lcb_3b980fb7d0b250b4777deae41df4b874
| "{\"inputs\": [\"5\\n2\\n1 2\\n6\\n10 2 3 6 1 3\\n4\\n1000000000 1000000000 1000000000 1000000000\\n(...TRUNCATED) |
code
|
PYTHON
|
|
"<|User|>You are an expert Python programmer. You will be given a question (problem specificatio(...TRUNCATED) | "A subarray is a continuous part of array.\n\nYarik recently found an array $a$ of $n$ elements and (...TRUNCATED) |
deepcoder_lcb_dfa36ec9f5252437c72dd54ec8aa1f01
| "{\"inputs\": [\"7\\n5\\n1 2 3 4 5\\n4\\n9 9 8 8\\n6\\n-1 4 -1 0 5 -4\\n4\\n-1 2 4 -3\\n1\\n-1000\\n(...TRUNCATED) |
code
|
PYTHON
|
|
"<|User|>You are an expert Python programmer. You will be given a question (problem specificatio(...TRUNCATED) | "Yarik is a big fan of many kinds of music. But Yarik loves not only listening to music but also wri(...TRUNCATED) |
deepcoder_lcb_b61e755e9915a69a8dbaa46560dd641a
| "{\"inputs\": [\"5\\n1\\n2\\n4\\n3 1 3 2\\n2\\n1000 1000\\n3\\n1 1 1\\n19\\n2 4 1 6 2 8 5 4 2 10 5 1(...TRUNCATED) |
code
|
PYTHON
|
|
"<|User|>You are an expert Python programmer. You will be given a question (problem specificatio(...TRUNCATED) | "You are given a 0-indexed array of strings details. Each element of details provides information ab(...TRUNCATED) |
deepcoder_lcb_f53e4f1cc0eb2c2799de0a76f941cc8d
|
class Solution:
def countSeniors(self, details: List[str]) -> int:
| "{\"inputs\": [\"[\\\"7868190130M7522\\\", \\\"5303914400F9211\\\", \\\"9273338290F4010\\\"]\", \"[\(...TRUNCATED) |
code
|
PYTHON
|
"<|User|>You are an expert Python programmer. You will be given a question (problem specificatio(...TRUNCATED) | "You are given a 0-indexed 2D integer array nums. Initially, your score is 0. Perform the following (...TRUNCATED) |
deepcoder_lcb_f8001dcf81982c7afc91aa0803f58ee5
|
class Solution:
def matrixSum(self, nums: List[List[int]]) -> int:
| "{\"inputs\": [\"[[7, 2, 1], [6, 4, 2], [6, 5, 3], [3, 2, 1]]\", \"[[1]]\", \"[[0], [10], [25], [2],(...TRUNCATED) |
code
|
PYTHON
|
This dataset contains the training and testing data used for reinforcement learning in the AReaL-boba-2 model on coding tasks.
train/
: Contains the training data for RL fine-tuning.code_benchmark/
: Contains the evaluation benchmark, organized into multiple subfolders, each corresponding to a specific coding benchmark suite, Codeforces
, Code Contests
and LiveCodeBench (v5)
are supported now.To train and evaluate models using this dataset with AReaL:
code_benchmark/
to the evaluation/data/
directory in the AReaL repository.import json
with open("/path/to/raw.jsonl") as f, \
open("/path/to/qwen3_data.jsonl", "w") as fout:
for line in f:
data = json.loads(line)
prompt = data['prompt']
prompt = prompt.replace(
"<|User|>", "<|im_start|>user\n"
).replace(
"<|Assistant|>", "\n/think<|im_end|>\n<|im_start|>assistant\n"
)
data['prompt'] = prompt
print(json.dumps(data), file=fout)
Please refer to the LICENSE file associated with this dataset or contact the maintainers for more details.