mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-18 04:32:00 +00:00
24 lines
372 B
C++
24 lines
372 B
C++
#include <iostream>
|
|
|
|
using std::cin;
|
|
using std::cout;
|
|
using std::endl;
|
|
|
|
const int N = 2005;
|
|
|
|
int n, x;
|
|
bool tag[N];
|
|
|
|
int main() {
|
|
std::ios::sync_with_stdio(false);
|
|
cin >> n;
|
|
do {
|
|
tag[x] = true;
|
|
int t = 0;
|
|
while (tag[++t] && t <= 2 * n + 1) {}
|
|
tag[t] = true;
|
|
cout << t << endl;
|
|
} while (cin >> x, x);
|
|
return 0;
|
|
}
|