結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー Mister
提出日時 2020-04-13 11:49:54
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 423 bytes
コンパイル時間 958 ms
コンパイル使用メモリ 71,920 KB
最終ジャッジ日時 2025-01-09 17:55:57
ジャッジサーバーID
(参考情報)
judge4 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

void solve() {
    int n, k;
    std::cin >> n >> k;

    int m = (n - 1) % (k + 1);
    while (true) {
        std::cout << m << std::endl;
        m += k + 1;

        int x;
        std::cin >> x;
        if (x >= n) break;
    }
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}
0