結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー fiord
提出日時 2015-07-31 22:54:57
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 317 bytes
コンパイル時間 1,246 ms
コンパイル使用メモリ 159,244 KB
実行使用メモリ 25,604 KB
平均クエリ数 3.30
最終ジャッジ日時 2024-07-16 05:19:16
合計ジャッジ時間 4,783 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7 WA * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int n,k;
int input(){
	int b;	cin>>b;
	return b;
}
int output(int now){
	int b=input();
	if(b>=n)	exit(0);
	int next=now+(k+1);
	cout<<next<<endl;
	return next;
}
int main(){
	cin>>n>>k;
	cout<<(n-1)%(k+1)<<endl;
	int now=0;
	while(1){
		now=output(now);
	}
	return 0;
}
0