結果

問題 No.257 N言っちゃダメゲーム (3)
コンテスト
ユーザー nanasili
提出日時 2015-07-31 22:39:47
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 695 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 539 ms
コンパイル使用メモリ 100,276 KB
実行使用メモリ 90,396 KB
最終ジャッジ日時 2026-03-31 10:03:13
合計ジャッジ時間 7,107 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other TLE * 1 -- * 29
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <algorithm>
#include <vector>
#include <cfloat>
#include <string>
#include <cmath>
#include <set>
#include <cstdlib>
#include <map>
#include <ctime>
#include <iomanip>
#include <functional>
#include <deque>
#include <iostream>
#include <cstring>
#include <queue>
#include <cstdio>
#include <stack>
#include <climits>
#include <sys/time.h>
#include <cctype>

using namespace std;

typedef long long ll;


int main() {
  ll n, k;
  scanf("%lld %lld", &n, &k);
  if (n-1 <= k) {
    printf("%lld\n", n-1);
    return 0;
  }

  ll r = 0;
  if (n%(k+1) == 1) {
    puts("0");
    scanf("%lld", &r);
  }
  while (r < n) {
    printf("%lld\n", (r+k)/(k+1)*(k+1));
    scanf("%lld", &r);
  }
}
0