TOKI Regular Open Contest #22 E問目 - On Off

Source

TOKI Regular Open Contest #22
問題文
Problemset (TOKI Regular Open Contest #22)

問題概要

省略

解法

省略

cLay(version 20210904-1)のコード

C++に変換後のコードはこちら

//interactive
ll X, Y, A, B;

int q(ll i){
  wt("?", i+1);
  return rd_int();
}

{
  ll @N, fc, sc, f;

  f = q(0);
  fc = 1;
  while(q(fc) == f) fc *= 2;
  fc = bsearch_min[ll,x,1,fc](q(x) != f);

  sc = fc;
  while(q(fc+sc) != f) sc *= 2;
  sc = bsearch_min[ll,x,1,sc](q(fc+x) == f);

  X = sc;
  A = (f+1) * X - fc;
  Y = (N + A) /+ (2*X);
  B = (2*X*Y - N - A);
  wt("!", X, Y, A, B);
}

Current time: 2024年04月25日14時04分03秒
Last modified: 2021年09月05日10時57分24秒 (by laycrs)
Tags: Competitive_Programming_Incomplete TOKI
トップページに戻る

Logged in as: unknown user (not login)

ログイン: