4 2 4 1 3 2
6
Six integer sequences $A$ satisfy both of the conditions: $(1, 1, 1, 2)$, $(1, 1, 2, 2)$, $(1, 2, 1, 2)$, $(1, 2, 2, 2)$, $(2, 1, 1, 2)$, and $(2, 1, 2, 2)$.
For instance, when $A = (1, 1, 1, 2)$, we have $(A_{P_1}, A_{P_2}, A_{P_3}, A_{P_4}) = (2, 1, 1, 1)$, which is lexicographically larger than $A$.1 1 1
0
20 100000 11 15 3 20 17 6 1 9 5 19 10 16 7 8 12 2 18 14 4 13
55365742
{
"problem": {
"name": "A < AP",
"description": {
"content": "You are given a permutation $P = (P_1, P_2, \\ldots, P_N)$ of $(1, 2, \\ldots, N)$. Print the number of integer sequences $A = (A_1, A_2, \\ldots, A_N)$ of length $N$ that satisfy both of the conditions ",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "arc151_b"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given a permutation $P = (P_1, P_2, \\ldots, P_N)$ of $(1, 2, \\ldots, N)$.\nPrint the number of integer sequences $A = (A_1, A_2, \\ldots, A_N)$ of length $N$ that satisfy both of the conditions ...",
"is_translate": false,
"language": "English"
}
]
}