mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-24 01:08:47 +00:00
C - Yamanote Line Game
https://atcoder.jp/contests/abc244/submissions/30281264
This commit is contained in:
parent
767bcb2c2c
commit
a9d2dced1e
23
AtCoder/ABC244/C/C.cpp
Normal file
23
AtCoder/ABC244/C/C.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user