3 2 3 6 -1 1 -1
1 For example, consider creating the following three sequences: 1. $(1,2,3)$ 2. $(2,1,1)$ 3. $(3,3,2)$ In this case, when sorting $s_i$ and $t_i$ lexicographically, we have: > $t_2 = (1,1,2) < s_1 = (1,2,3) < s_2 = (2,1,1) < t_3 = (2,3,3) < t_1 = (3,2,1) < s_3 = (3,3,2)$ Thus, $(a_1,a_2,a_3,b_1,b_2,b_3) = (2,3,6,5,1,4)$. Here, $a$ matches the given $A$, and the second element of $b$ also matches that of $B$, so this is one pair of sequences $a,b$ satisfying the conditions. On the other hand, if we create the following three sequences, $s_1$ and $t_1$ become identical, so $a$ and $b$ are not defined. 1. $(1,2,1)$ 2. $(2,1,3)$ 3. $(3,3,2)$ In fact, $a=(2,3,6), b=(5,1,4)$ is the only pair of sequences satisfying the conditions.
15 5 16 1 12 30 20 4 13 9 8 24 21 26 28 17 -1 -1 6 -1 -1 -1 -1 -1 -1 -1 -1 29 -1 -1 -1
758094847 Print the count modulo $998244353$.
{
"problem": {
"name": "Mirror and Order",
"description": {
"content": "You are going to create $N$ sequences of length $3$, satisfying the following conditions. * For each of $k = 1,2,3$, the following holds: * Among the $k$\\-th elements of the sequences, each i",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "arc188_d"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are going to create $N$ sequences of length $3$, satisfying the following conditions.\n\n* For each of $k = 1,2,3$, the following holds:\n * Among the $k$\\-th elements of the sequences, each i...",
"is_translate": false,
"language": "English"
}
]
}