結果

問題 No.3788 Floor Sum Queries
コンテスト
ユーザー hiro1729
提出日時 2026-09-17 16:51:23
言語 C++23
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 346 ms / 2,000 ms
+ 999µs
コード長 423 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,429 ms
コンパイル使用メモリ 337,060 KB
実行使用メモリ 9,696 KB
平均クエリ数 267.67
最終ジャッジ日時 2026-11-06 20:51:54
合計ジャッジ時間 4,312 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int L = 1000000;

int main() {
	int T; cin >> T;
	while (T--) {
		ll R1, R2;
		cout << "? " << L << ' ' << 0 << endl;
		cin >> R1;
		if (R1 == -1) return 0;
		cout << "? " << L << ' ' << L << endl;
		cin >> R2;
		if (R2 == -1) return 0;
		int N = (2 * R2 - 1) / (R2 - R1), st;
		cout << "! " << N << endl;
		cin >> st;
		if (st == -1) return 0;
	}
}
0