5 ABCBC ACAAB
Yes AC..B .BA.C C.BA. BA.C. ..CBA The grid in the output example satisfies all the following conditions, so it will be treated as correct. * Each row contains exactly one `A`, one `B`, and one `C`. * Each column contains exactly one `A`, one `B`, and one `C`. * The leftmost characters written in the rows are `A`, `B`, `C`, `B`, `C` from top to bottom. * The topmost characters written in the columns are `A`, `C`, `A`, `A`, `B` from left to right.
3 AAA BBB
No For this input, there is no way to fill the grid to satisfy the conditions.
{
"problem": {
"name": "ABC Puzzle",
"description": {
"content": "You are given an integer $N$ and strings $R$ and $C$ of length $N$ consisting of `A`, `B`, and `C`. Solve the following problem. There is a $N \\times N$ grid. All cells are initially empty. You can ",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 4000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc326_d"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given an integer $N$ and strings $R$ and $C$ of length $N$ consisting of `A`, `B`, and `C`. Solve the following problem.\nThere is a $N \\times N$ grid. All cells are initially empty. \nYou can ...",
"is_translate": false,
"language": "English"
}
]
}