結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー naimonon77naimonon77
提出日時 2016-01-02 22:48:28
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 809 bytes
コンパイル時間 441 ms
コンパイル使用メモリ 61,660 KB
実行使用メモリ 24,228 KB
平均クエリ数 3.70
最終ジャッジ日時 2023-09-23 23:03:55
合計ジャッジ時間 3,754 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
23,532 KB
testcase_01 AC 42 ms
23,868 KB
testcase_02 AC 42 ms
23,856 KB
testcase_03 AC 43 ms
23,268 KB
testcase_04 AC 43 ms
23,652 KB
testcase_05 AC 42 ms
23,664 KB
testcase_06 AC 42 ms
23,364 KB
testcase_07 AC 41 ms
23,868 KB
testcase_08 AC 39 ms
23,388 KB
testcase_09 AC 40 ms
23,628 KB
testcase_10 AC 40 ms
23,376 KB
testcase_11 AC 42 ms
23,520 KB
testcase_12 AC 41 ms
23,880 KB
testcase_13 AC 41 ms
23,856 KB
testcase_14 AC 41 ms
23,520 KB
testcase_15 AC 42 ms
23,400 KB
testcase_16 AC 42 ms
23,448 KB
testcase_17 AC 44 ms
23,352 KB
testcase_18 AC 41 ms
23,664 KB
testcase_19 AC 42 ms
23,256 KB
testcase_20 AC 39 ms
23,256 KB
testcase_21 AC 42 ms
23,640 KB
testcase_22 AC 40 ms
23,268 KB
testcase_23 AC 40 ms
24,024 KB
testcase_24 AC 41 ms
24,108 KB
testcase_25 AC 40 ms
23,652 KB
testcase_26 AC 40 ms
23,664 KB
testcase_27 AC 42 ms
24,228 KB
testcase_28 AC 43 ms
24,228 KB
testcase_29 AC 42 ms
23,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstring>
#include <algorithm>
#include <limits.h>
#include <cmath>
#include <time.h>
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

int test = 0;
/* ここからが本編 */
int main(void)
{
  int i,j,k,l;
  int N,K;
  int n;
  int rep;
  cin >> N >> K;
  if(N % (K+1) == 1) {
    puts("0");
    cin >> rep;
    n = K+1;
    while(n < N) {
      cout << n << endl;
      n += K+1;
      cin >> rep;
      if(rep >= N) break;
    }
  }
  else {
    if(N % (K+1) != 0) n = N % (K+1) - 1;
    else n = K;
    while(n < N) {
      cout << n << endl;
      n += K+1;
      cin >> rep;
      if(rep >= N) break;
    }
  }
  return 0;
}
0