2 b m m d
Yes The $1$\-st user with a current handle `b` wants to change it to `m`. The $2$\-nd user with a current handle `m` wants to change it to `d`. First, you change the $2$\-nd user's handle from `m` to `d`; then you change the $1$\-st user's handle from `b` to `m`. This way, you can achieve the objective. Note that you cannot change the $1$\-st user's handle to `m` at first, because it is used by the $2$\-nd user at that point.
3 a b b c c a
No The $1$\-st user with a current handle `a` wants to change it to `b`. The $2$\-nd user with a current handle `b` wants to change it to `c`. The $3$\-rd user with a current handle `c` wants to change it to `a`. We cannot change their handles subject to the conditions.
5 aaa bbb yyy zzz ccc ddd xxx yyy bbb ccc
Yes
{
"problem": {
"name": "Change Usernames",
"description": {
"content": "You run a web service with $N$ users. The $i$\\-th user with a current handle $S_i$ wants to change it to $T_i$. Here, $S_1,\\ldots$, and $S_N$ are pairwise distinct, and so are $T_1,\\ldots$, and $T_N",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc285_d"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You run a web service with $N$ users.\nThe $i$\\-th user with a current handle $S_i$ wants to change it to $T_i$. \nHere, $S_1,\\ldots$, and $S_N$ are pairwise distinct, and so are $T_1,\\ldots$, and $T_N...",
"is_translate": false,
"language": "English"
}
]
}