3 1 2 4 2 3 4
4
Let $S$ be the set of card numbers to flip.
For example, when $S={2,3}$ is chosen, the integers written on their visible sides are $1,2$, and $4$, from card $1$ to card $3$, so it satisfies the condition.
On the other hand, when $S={3}$ is chosen, the integers written on their visible sides are $1,4$, and $4$, from card $1$ to card $3$, where the integers on card $2$ and card $3$ are the same, violating the condition.
Four $S$ satisfy the conditions: ${},{1},{2}$, and ${2,3}$.4 1 5 2 6 3 7 4 8
16
8 877914575 602436426 861648772 623690081 476190629 262703497 971407775 628894325 822804784 450968417 161735902 822804784 161735902 822804784 822804784 161735902
48
{
"problem": {
"name": "Flip Cards",
"description": {
"content": "$N$ cards, numbered $1$ through $N$, are arranged in a line. For each $i\\ (1\\leq i < N)$, card $i$ and card $(i+1)$ are adjacent to each other. Card $i$ has $A_i$ written on its front, and $B_i$ writt",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc291_d"
},
"statements": [
{
"statement_type": "Markdown",
"content": "$N$ cards, numbered $1$ through $N$, are arranged in a line. For each $i\\ (1\\leq i < N)$, card $i$ and card $(i+1)$ are adjacent to each other. Card $i$ has $A_i$ written on its front, and $B_i$ writt...",
"is_translate": false,
"language": "English"
}
]
}