結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー bal4ubal4u
提出日時 2019-09-05 15:37:44
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 426 bytes
コンパイル時間 593 ms
コンパイル使用メモリ 27,720 KB
実行使用メモリ 24,336 KB
平均クエリ数 8.00
最終ジャッジ日時 2023-09-23 18:13:20
合計ジャッジ時間 4,208 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
23,400 KB
testcase_01 AC 39 ms
23,640 KB
testcase_02 WA -
testcase_03 AC 39 ms
24,036 KB
testcase_04 AC 40 ms
23,904 KB
testcase_05 AC 39 ms
23,304 KB
testcase_06 AC 39 ms
23,700 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 38 ms
24,120 KB
testcase_17 WA -
testcase_18 AC 40 ms
24,060 KB
testcase_19 AC 41 ms
24,180 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

// yukicoder: 257 N言っちゃダメゲーム (3)
// 2019.9.5 bal4u

#include <stdio.h>
#include <stdlib.h>

int N;
void out(int x) { printf("%d\n", x), fflush(stdout); }
void in() {
	int you;
	scanf("%d", &you);
	if (you >= N) exit(0);
}

int main()
{
	int p, K, first;
	
	scanf("%d%d", &N, &K);
	if ((N-1)%(K+1) == 0) out(0), first = 0, p = 0; else out(1), first = 1, p = 1;
	while (1) in(), p += K+1, out(p);
	return 0;
}
0