Let \(\mathbb {N}\) be the set of all nonnegative integers. For a set \(A\subseteq \mathbb {N}\) , let \(R_1(A,n)\) be the number of solutions of the equation \(n=a_1+a_2\) with \(a_1,a_2\in A\) . Let K be a positive integer, g be an even integer with \(-K\le g/2\le K\) , and l be an odd integer with \(-K\le (l+1)/2\le K+1\) . In this paper, we determine the structure of the set \(A\subseteq \mathbb {N}\) such that \(R_1(A,2k-1)-R_1(\mathbb {N}\setminus A,2k-1)=g\) for all integers \(k\ge K\) and the structure of the set \(A\subseteq \mathbb {N}\) such that \(R_1(A,2k)-R_1(\mathbb {N}\setminus A,2k)=l\) for all integers \(k\ge K\) .