結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー 👑 CleyL
提出日時 2022-09-23 09:15:12
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 265 bytes
コンパイル時間 767 ms
コンパイル使用メモリ 66,312 KB
最終ジャッジ日時 2025-02-07 13:49:33
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main(){
  int n,k;cin>>n>>k;
  cout << (n-1)%(k+1) << endl;
  int nw = 1;
  int rem = (n-1)%(k+1);
  while(true){
    int x;cin>>x;
    if(x >= n){
      return 0;
    }
    cout << nw*(k+1)+rem << endl;
    nw++;
  }
}
0