結果
| 問題 | 
                            No.257 N言っちゃダメゲーム (3)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             fiord
                         | 
                    
| 提出日時 | 2015-07-31 22:59:21 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                            (最新)
                                AC
                                 
                             
                            (最初)
                            
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 379 bytes | 
| コンパイル時間 | 1,136 ms | 
| コンパイル使用メモリ | 159,372 KB | 
| 実行使用メモリ | 25,604 KB | 
| 平均クエリ数 | 3.13 | 
| 最終ジャッジ日時 | 2024-07-16 05:19:27 | 
| 合計ジャッジ時間 | 4,326 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 4 WA * 26 | 
ソースコード
#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;
	if(n<=k+1){
		cout<<k<<endl;
		int e=input();
		return 0;
	}
	cout<<(n-1)%(k+1)<<endl;
	int now=0;
	while(1){
		now=output(now);
	}
	return 0;
}
            
            
            
        
            
fiord