結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー 158b158b
提出日時 2015-07-31 22:41:07
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 46 ms / 2,000 ms
コード長 842 bytes
コンパイル時間 542 ms
コンパイル使用メモリ 75,844 KB
実行使用メモリ 24,420 KB
平均クエリ数 3.70
最終ジャッジ日時 2023-09-23 21:04:37
合計ジャッジ時間 3,338 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
23,448 KB
testcase_01 AC 40 ms
23,412 KB
testcase_02 AC 41 ms
23,856 KB
testcase_03 AC 40 ms
24,024 KB
testcase_04 AC 40 ms
24,060 KB
testcase_05 AC 41 ms
23,664 KB
testcase_06 AC 40 ms
23,616 KB
testcase_07 AC 41 ms
23,664 KB
testcase_08 AC 40 ms
23,460 KB
testcase_09 AC 40 ms
23,664 KB
testcase_10 AC 42 ms
23,412 KB
testcase_11 AC 41 ms
24,060 KB
testcase_12 AC 40 ms
24,036 KB
testcase_13 AC 41 ms
24,288 KB
testcase_14 AC 40 ms
24,312 KB
testcase_15 AC 40 ms
24,276 KB
testcase_16 AC 42 ms
24,324 KB
testcase_17 AC 41 ms
24,060 KB
testcase_18 AC 42 ms
23,676 KB
testcase_19 AC 41 ms
23,412 KB
testcase_20 AC 40 ms
24,060 KB
testcase_21 AC 40 ms
23,412 KB
testcase_22 AC 40 ms
23,436 KB
testcase_23 AC 40 ms
24,096 KB
testcase_24 AC 40 ms
24,420 KB
testcase_25 AC 39 ms
23,580 KB
testcase_26 AC 41 ms
23,412 KB
testcase_27 AC 39 ms
23,664 KB
testcase_28 AC 38 ms
23,448 KB
testcase_29 AC 39 ms
23,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <climits>
#include <vector>
#include <numeric>
#include <complex>
#include <map>
#include <bitset>
#include <stack>
#include <queue>
using namespace std;

//#define __int64 long long
#define long __int64
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
const int Vecy[4] = {0,-1,0,1};
const int Vecx[4] = {1,0,-1,0};


int main(){
	int n,k;
	int mode = 0;					//先手
	int in = 0;
	int next;
	cin >> n >> k;
	
	next = (n - 1) % (k + 1);
	if(next == 0){
		next += k + 1;
		mode = 1;
		cout << 0 << endl;
	}
	
	while(true){
		if(mode == 0){	//自分のターン
			cout << next << endl;
			next += k + 1;
		}else{			//相手のターン
			cin >> in;
			if(in >= n){
				return 0;
			}
		}
		mode = 1 - mode;
	}
	
    
    return 0;
}
0