P17548 [JAG 2026 Summer Camp #2] Longest Path on DAG
Description
**This is an interactive problem.**
You are given a positive integer $N$ and a sequence $S=(S_1,S_2,\ldots,S_N)$ of length $N$ whose elements are all either $0$ or $1$.
There is a directed bipartite graph $G$ with $N$ vertices numbered $1,2,\ldots,N$. Each vertex of $G$ is colored: vertex $v$ is white if $S_v=0$ and black if $S_v=1$. Every directed edge $(u,v)$ in $G$ satisfies both of the following conditions:
- $u
Input Format
N/A
Output Format
N/A
Explanation/Hint
In this sample interaction, the hidden graph has the edge set $E(G)=\{(1,2),(1,3),(1,5),(3,4),(4,5)\}$. This information is not given to the program.