Solution (source code)

= Solution

After every proposed <pixel> has passed part (d), insist on exactly one call in every column of the closed endpoint interval:

``
void final()
{
    for (int x = x0; x <= x1; x++) {
        if (counter[x] != 1) reject();
    }
    accept();
}
``

Part (d) already rejected every out-of-range column and every incorrect ordinate. A zero counter now detects an omitted column; a counter greater than one detects a repeated call in that column. Because the residual interval in part (d) allows exactly one <integer> ordinate in each column, accepted calls in a repeated column must address the same <pixel>. Conversely, a counter of one in every column forces the complete set of nearest <pixels>, including both endpoints. Consecutive correct columns differ in ordinate by at most one, which proves that there are no gaps in the resulting thin <line segment>.

The verifier certifies the final plotted set; it need not require calls to arrive in increasing $x$ order. Its final condition is simply
$$
\boxed{\operatorname{counter}[x]=1\quad\text{for every }x=x_0,\ldots,x_1.}
$$