結果

問題 No.3521 接線の傾き
コンテスト
ユーザー yamate11
提出日時 2026-05-01 22:10:47
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 918 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,415 ms
コンパイル使用メモリ 328,644 KB
実行使用メモリ 30,052 KB
平均クエリ数 3.00
最終ジャッジ日時 2026-05-01 22:10:55
合計ジャッジ時間 5,110 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
#include <cassert>
using namespace std;
using ll = long long int;
using u64 = unsigned long long;
using pll = pair<ll, ll>;
// #include <atcoder/all>
// using namespace atcoder;
#define REP(i, a, b) for (ll i = (a); i < (b); i++)
#define REPrev(i, a, b) for (ll i = (a); i >= (b); i--)
#define ALL(coll) (coll).begin(), (coll).end()
#define SIZE(v) ((ll)((v).size()))
#define REPOUT(i, a, b, exp, sep) REP(i, (a), (b)) cout << (exp) << (i + 1 == (b) ? "" : (sep)); cout << "\n"

// @@ !! LIM()

int main(/* int argc, char *argv[] */) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << setprecision(20);

  auto ask = [&](ll x) -> ll {
    cout << "? " << x << endl;
    ll r; cin >> r;
    return r;
  };
  auto report = [&](ll y) -> void {
    cout << "! " << y << endl;
    return;
  };

  ll D; cin >> D;
  ll a = ask(0);
  ll b = ask(1);
  report(b - a);


  return 0;
}

0