From a9d2dced1e6908bb86b4e635cd0c1538753ace9f Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Sun, 20 Mar 2022 20:18:20 +0800 Subject: [PATCH] C - Yamanote Line Game https://atcoder.jp/contests/abc244/submissions/30281264 --- AtCoder/ABC244/C/C.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 AtCoder/ABC244/C/C.cpp diff --git a/AtCoder/ABC244/C/C.cpp b/AtCoder/ABC244/C/C.cpp new file mode 100644 index 00000000..431d8984 --- /dev/null +++ b/AtCoder/ABC244/C/C.cpp @@ -0,0 +1,23 @@ +#include + +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; +}