4 3 2 4 3 1 4 3
3 Initially, the condition is not satisfied because, for instance, for vertices $2$, $4$, and $3$, there are directed edges from vertex $2$ to vertex $4$ and from vertex $4$ to vertex $3$, but not from vertex $2$ to vertex $3$. You can make the graph satisfy the condition by adding the following three directed edges: * one from vertex $2$ to vertex $3$, * one from vertex $2$ to vertex $1$, and * one from vertex $4$ to vertex $1$. On the other hand, the condition cannot be satisfied by adding two or fewer edges, so the answer is $3$.
292 0
0
5 8 1 2 2 1 1 3 3 1 1 4 4 1 1 5 5 1
12
{
"problem": {
"name": "Transitivity",
"description": {
"content": "You are given a simple directed graph with $N$ vertices numbered $1$ to $N$ and $M$ edges numbered $1$ to $M$. Edge $i$ is a directed edge from vertex $u_i$ to vertex $v_i$. You may perform the follow",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc292_e"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given a simple directed graph with $N$ vertices numbered $1$ to $N$ and $M$ edges numbered $1$ to $M$. Edge $i$ is a directed edge from vertex $u_i$ to vertex $v_i$.\nYou may perform the follow...",
"is_translate": false,
"language": "English"
}
]
}