結果

問題 No.2357 Guess the Function
ユーザー 👑 ygussany
提出日時 2023-06-04 19:09:05
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 24 ms / 1,000 ms
コード長 318 bytes
コンパイル時間 441 ms
コンパイル使用メモリ 27,648 KB
実行使用メモリ 25,220 KB
平均クエリ数 2.91
最終ジャッジ日時 2024-12-29 03:42:26
合計ジャッジ時間 1,855 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main()
{
	int y, yy;
	printf("? 100\n");
	fflush(stdout);
	scanf("%d", &y);
	if (y < 99) {
		printf("? %d\n", 100 - (y + 1));
		fflush(stdout);
		scanf("%d", &yy);
	} else yy = 99;
	
	int A, B;
	B = yy + 1;
	A = ((y - 100) % B + B) % B;
	printf("! %d %d\n", A, B);
	fflush(stdout);
	return 0;
}
0