結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー ldsybldsyb
提出日時 2016-03-16 17:08:20
言語 C++11
(gcc 11.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 519 bytes
コンパイル時間 495 ms
コンパイル使用メモリ 51,460 KB
実行使用メモリ 37,272 KB
平均クエリ数 0.20
最終ジャッジ日時 2023-09-23 23:19:59
合計ジャッジ時間 4,132 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
24,288 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main(){
   int i,o,n,k;
   cin >> n >> k;
   if((n - 1) % (k + 1) == 0){
      cout << 0 << endl;
      cin >> i;
      o = k + 1;
      while(o < n){
         cout << o << endl;
         o += k + 1;
         cin >> i;
         if(i > n) return 0;
      }
   }else{
      if((n - 1) % (k + 1) != -1) o = (n - 1) % (k + 1);
      else o = k;
      while(o < n){
         cout << n << endl;
         n += k + 1;
         cin >> i;
         if(i > n) return 0;
      }
   }
}
0