problem_id
stringlengths 7
9
| prompt
stringlengths 926
4.52k
| task_type
stringclasses 1
value | verification_info
stringlengths 716
168M
|
|---|---|---|---|
lcbv5_1
|
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.
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)
|
deepcoder
|
{"ground_truth": "[{\"input\": \"6\\nabc\\nacb\\nbac\\nbca\\ncab\\ncba\\n\", \"output\": \"YES\\nYES\\nYES\\nNO\\nNO\\nYES\\n\", \"testtype\": \"stdin\", \"metadata\": {\"func_name\": null}}, {\"input\": \"1\\nabc\\n\", \"output\": \"YES\\n\", \"testtype\": \"stdin\", \"metadata\": {\"func_name\": null}}, {\"input\": \"3\\nabc\\nabc\\nabc\\n\", \"output\": \"YES\\nYES\\nYES\\n\", \"testtype\": \"stdin\", \"metadata\": {\"func_name\": null}}, {\"input\": \"5\\ncab\\nacb\\ncba\\nbac\\nbca\\n\", \"output\": \"NO\\nYES\\nYES\\nYES\\nNO\\n\", \"testtype\": \"stdin\", \"metadata\": {\"func_name\": null}}, {\"input\": \"6\\nabc\\nabc\\nabc\\nabc\\nabc\\nabc\\n\", \"output\": \"YES\\nYES\\nYES\\nYES\\nYES\\nYES\\n\", \"testtype\": \"stdin\", \"metadata\": {\"func_name\": null}}]", "dataset_type": "livecodebench"}
|
lcbv5_2
| "You are an expert Python programmer. You will be given a question (problem specification) and will (...TRUNCATED)
|
deepcoder
| "{\"ground_truth\": \"[{\\\"input\\\": \\\"4\\\\n4\\\\n2 2 1 2\\\\n3\\\\n0 1 2\\\\n5\\\\n4 3 2 3 4\\(...TRUNCATED)
|
lcbv5_3
| "You are an expert Python programmer. You will be given a question (problem specification) and will (...TRUNCATED)
|
deepcoder
| "{\"ground_truth\": \"[{\\\"input\\\": \\\"8\\\\n6 3\\\\nWBWWWB\\\\n7 3\\\\nWWBWBWW\\\\n5 4\\\\nBWBW(...TRUNCATED)
|
lcbv5_4
| "You are an expert Python programmer. You will be given a question (problem specification) and will (...TRUNCATED)
|
deepcoder
| "{\"ground_truth\": \"[{\\\"input\\\": \\\"15\\\\n2 5\\\\n7 3\\\\n3 3\\\\n7 4 1\\\\n5 2\\\\n9 7 7 3 (...TRUNCATED)
|
lcbv5_5
| "You are an expert Python programmer. You will be given a question (problem specification) and will (...TRUNCATED)
|
deepcoder
| "{\"ground_truth\": \"[{\\\"input\\\": \\\"6\\\\n1\\\\n3\\\\n5\\\\n100\\\\n999\\\\n1000\\\\n\\\", \\(...TRUNCATED)
|
lcbv5_6
| "You are an expert Python programmer. You will be given a question (problem specification) and will (...TRUNCATED)
|
deepcoder
| "{\"ground_truth\": \"[{\\\"input\\\": \\\"5\\\\n2\\\\n1 2\\\\n6\\\\n10 2 3 6 1 3\\\\n4\\\\n10000000(...TRUNCATED)
|
lcbv5_7
| "You are an expert Python programmer. You will be given a question (problem specification) and will (...TRUNCATED)
|
deepcoder
| "{\"ground_truth\": \"[{\\\"input\\\": \\\"7\\\\n5\\\\n1 2 3 4 5\\\\n4\\\\n9 9 8 8\\\\n6\\\\n-1 4 -1(...TRUNCATED)
|
lcbv5_8
| "You are an expert Python programmer. You will be given a question (problem specification) and will (...TRUNCATED)
|
deepcoder
| "{\"ground_truth\": \"[{\\\"input\\\": \\\"5\\\\n1\\\\n2\\\\n4\\\\n3 1 3 2\\\\n2\\\\n1000 1000\\\\n3(...TRUNCATED)
|
lcbv5_9
| "You are an expert Python programmer. You will be given a question (problem specification) and will (...TRUNCATED)
|
deepcoder
| "{\"ground_truth\": \"[{\\\"input\\\": \\\"[\\\\\\\"7868190130M7522\\\\\\\", \\\\\\\"5303914400F9211(...TRUNCATED)
|
lcbv5_10
| "You are an expert Python programmer. You will be given a question (problem specification) and will (...TRUNCATED)
|
deepcoder
| "{\"ground_truth\": \"[{\\\"input\\\": \\\"[[7, 2, 1], [6, 4, 2], [6, 5, 3], [3, 2, 1]]\\\", \\\"out(...TRUNCATED)
|
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 12