QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#882709#9734. Identify ChordrbtreeWA 68ms3584kbC++266.1kb2025-02-05 10:52:072025-02-05 10:52:08

Judging History

This is the latest submission verdict.

  • [2025-02-05 10:52:08]
  • Judged
  • Verdict: WA
  • Time: 68ms
  • Memory: 3584kb
  • [2025-02-05 10:52:07]
  • Submitted

answer

#include "bits/stdc++.h"
constexpr int __FREAD__ = 0;
constexpr char __FIN__[] = "";
constexpr char __FOUT__[] = "";
constexpr bool MTS = true;
constexpr bool SPC_MTS = false;
#define _LOAD_4(a, b, c, d, ...) d
#define _ALL_0(arg) begin(arg), end(arg)
#define _ALL_1(arg, l) (begin(arg) + (l)), end(arg)
#define _ALL_2(arg, l, r) (begin(arg) + (l)), (begin(arg) + (r) + 1)
#define ALL(...) _LOAD_4(__VA_ARGS__, _ALL_2, _ALL_1, _ALL_0)(__VA_ARGS__)

// :/

using namespace std;
using tp = long long int;
[[maybe_unused]] constexpr tp ZERO = 0, ONE = 1, INF = -1ull >> 2;
int WITHERING(int);
void MIST(int, char*[]);

template <typename _Ty> class _Lambda_t { _Ty lexp;public:template<typename __Ty
>_Lambda_t(__Ty&&lexp):lexp(static_cast<__Ty&&>(lexp)){}template<typename...__Ty
>decltype(auto)operator()(__Ty&&...args){return lexp(std::ref(*this),static_cast
<__Ty&&>(args)...); } }; template <typename _Ty> decltype (auto) lexp(_Ty&&l_exp
) {return _Lambda_t<typename std::decay<_Ty>::type>(static_cast<_Ty&&>(l_exp));}
struct SPLITMIX { static uint64_t splitmix(uint64_t x){x+=0x9e3779b97f4a7c15;x=(
x ^ (x >> 30)) * 0xbf58476d1ce4e5b9; x = (x ^ (x>>27))*0x94d049bb133111eb;return
x ^ (x >> 31); } size_t operator()(uint64_t x) const { static const uint64_t o =
chrono::steady_clock::now().time_since_epoch().count(); return splitmix(x+o);}};
template <typename _Ty> auto vcc(_Ty init, size_t s) { return std::vector<_Ty>(s
, init); } template <typename _Ty, typename... __Ty> auto vcc(_Ty init, size_t s
, __Ty... o) {auto ret=vcc(init,o...);return std::vector<decltype(ret)>(s,ret);}
template <typename _Ty1, typename _Ty2> bool ckmax(_Ty1& a, const _Ty2& b) { if(
a < b) { a = b; return true; } return false; } template <typename _Ty1, typename
_Ty2> bool ckmin(_Ty1& a, const _Ty2& b){if(b<a){a=b;return true;}return false;}
void RAW(char&x){if(__FREAD__!=0){static char buf[__FREAD__];static char*s=buf,*
e=buf;if(s==e){s=buf;e=buf+fread(buf,1,__FREAD__,stdin);if(s==e){x=EOF;return;}}
x = *s++; } else x = getchar(); } void bin(char& c){for(RAW(c);c==' '||c == '\n'
|| c == '\r'; RAW(c)); } void bin(std::string& x) { char c; for(RAW(c);c==' '||c
== '\n' || c == '\r'; RAW(c)); x = c; for (RAW(c); c!=' '&&c!='\n'&&c!='\r';RAW(
c)) x.push_back(c); } template <typename Ty> void bin(Ty& x) { bool sign = false
;char c; for (RAW(c); c < '0' || c > '9'; RAW(c)) if (c == '-') sign = true; for
(x = 0; '0' <= c && c <= '9'; RAW(c)) x = x * 10 + (c & 15); if (sign) x = -x; }
template <typename...> using bin_void_t =void;template<typename T,typename=void>
struct bin_it :std::false_type{};template<typename T>struct bin_it<T,bin_void_t<
typename std::iterator_traits<T>::iterator_category>>:std::true_type{};template<
typename T>struct bin_it<T*,void>:std::true_type{};template<typename T,typename=
typename std::enable_if<bin_it<T>::value>::type>void bin(T s,T e){while(s!=e)bin
(*s++);}template<typename...>struct bin_or:std::false_type{};template<typename T
, typename... O> struct bin_or<T,O...>:std::conditional<T::value,std::true_type,
bin_or<O...>>::type {}; template <typename... T>typename std::enable_if<!bin_or<
bin_it<typename std::decay<T>::type>...>::value, void>::type bin(T& ...x) {void(
(int[]) { 0, (bin(&x, &x + 1), 0) ... }); } tp bin() { tp x; cin>>x; return x; }
int main(int argc, char* argv[]) { int t = 0, _t = 1; if(MTS&&!SPC_MTS) bin(_t);
MIST(argc, argv); while(t<_t||SPC_MTS){if(WITHERING(++t)!=0)return 0;}return 0;}
#ifdef XCODE
#define bg(...){cout<<"["<<__LINE__<<'@'<<++_LT[__LINE__]<<':';BG(__VA_ARGS__);}
size_t _LT[21777]; template<typename _Type>void BG(const _Type&_cur){cout<<' '<<
_cur << ']' <<" <<:"<<std::endl;}template<typename _Type,typename... _Other>void
BG(const _Type& _cur, const _Other& ..._other) {cout<< ' '<<_cur;BG(_other...);}
#else
#define bg(...)
#endif

// :/

namespace lib {  // LIBLIBLIBLIBLIBLIBLIBLIBLIBLIBLIBLIBLIBLIBLIBLIBLIBLIBLIBLIB
class Random{mt19937_64 rd;public:Random(unsigned long long seed) {rd=mt19937_64
(seed); } long long operator()(long long l, long long r) { return l + rd() % (r-
l + 1); } } rng(reinterpret_cast<unsigned long long>(new char) * time(nullptr));
}  // LIB::RANDOM LIB::RANDOM LIB::RANDOM LIB::RANDOM LIB::RANDOM LIB::RANDOM LI

// :/

struct STRUGGLE {
   STRUGGLE() {
      if (strlen(__FIN__)) freopen(__FIN__, "r", stdin);
      if (strlen(__FOUT__)) freopen(__FOUT__, "w", stdout);
   }
   
   ~STRUGGLE() {
   }
} STRUGGLE;

int WITHERING([[maybe_unused]] int TEST_NUMBER) {
   int n; cin >> n;
   map<pair<int, int>, int> mem;
   auto ask = [&](int x, int y) {
      if ((x + 1) % n == y || (y + 1) % n == x) return 1;
      if (mem.count(minmax(x, y))) return mem[minmax(x, y)];
      cout << "? " << x + 1 << ' ' << y + 1 << endl;
      int t;
      cin >> t;
      return mem[minmax(x, y)] = t;
   };
   int x, y;
   int d;
   set<int> fd;
   while (true) {
      x = lib::rng(0, n - 1);
      y = (x + n / 2) % n;
      bool flag = false;
      if (n >= 1000000) {
         for (auto i : fd) {
            if (abs(x - i) <= 50000 || abs(y - i) <= 50000) {
               if (lib::rng(0, 500) != 0) {
                  flag = true;
                  break;
               }
            }
         }
      }
      if (flag) continue;
      fd.insert(x);
      fd.insert(y);
      d = ask(x, y);
      if (d != n / 2) break;
   }
   if (ask(x, (y + n - 1) % n) == d - 1) {
      int l = 1, r = n / 2;
      while (l <= r) {
         int mid = (l + r) >> 1;
         if (ask(x, (y + n - mid) % n) == d - mid) l = mid + 1;
         else r = mid - 1;
      }
      y = (y + n - r) % n;
   } else {
      int l = 1, r = n / 2;
      while (l <= r) {
         int mid = (l + r) >> 1;
         if (ask(x, (y + mid) % n) == d - mid) l = mid + 1;
         else r = mid - 1;
      }
      y = (y + r) % n;
   }
   d = ask(x, y);
   if (ask((x + d - 1) % n, y) == 1) x = (x + d - 1) % n;
   else x = (x + n - d + 1) % n;
   cout << "! " << x + 1 << ' ' << y + 1 << endl;
   cin >> x;
   return 0;
}

void MIST([[maybe_unused]] int argc, [[maybe_unused]] char* argv[]) {
}

// :\ */

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3584kb

input:

2
6
2
2
2
1
1
4
1
1

output:

? 1 4
? 1 3
? 1 5
? 2 4
! 2 4
? 1 3
! 1 3

result:

ok ok (2 test cases)

Test #2:

score: 0
Accepted
time: 11ms
memory: 3584kb

input:

1000
15
7
6
6
2
2
3
3
1
19
4
3
4
4
5
1
17
3
2
4
3
3
1
15
6
6
4
6
7
1
1
14
7
5
4
1
2
1
15
7
2
3
4
4
3
3
1
17
8
2
3
5
4
3
3
1
20
6
5
5
4
5
1
1
13
3
4
4
4
4
1
18
9
3
2
4
3
1
1
13
4
5
4
3
4
5
1
14
4
3
3
4
4
1
17
4
5
5
6
5
1
1
12
3
2
3
3
3
1
10
3
4
2
2
1
1
14
6
6
2
2
3
1
19
8
8
3
3
4
5
1
19
9
6
5
4
6
4
1...

output:

? 6 13
? 9 1
? 9 15
? 9 5
? 9 7
? 9 6
? 10 5
! 8 5
? 14 4
? 14 3
? 14 18
? 14 2
? 16 3
! 12 3
? 4 12
? 4 11
? 4 8
? 4 10
? 5 11
! 3 11
? 11 3
? 11 2
? 11 7
? 11 5
? 11 4
? 1 3
! 1 3
? 4 11
? 2 9
? 2 8
? 2 5
? 2 4
! 2 5
? 5 12
? 10 2
? 10 1
? 10 6
? 10 4
? 10 3
? 11 2
! 9 2
? 1 9
? 6 14
? 6 13
? 6 1
...

result:

ok ok (1000 test cases)

Test #3:

score: 0
Accepted
time: 10ms
memory: 3584kb

input:

1000
21
6
5
5
4
5
5
1
22
4
5
5
7
5
7
1
20
9
8
5
7
7
2
1
22
4
5
4
1
2
1
21
9
9
6
7
8
1
1
21
8
9
6
6
5
6
9
1
24
9
8
6
8
7
4
1
22
10
9
5
8
9
1
1
21
10
4
3
5
4
5
1
23
11
8
9
4
5
4
3
5
1
21
5
6
6
5
4
7
1
24
7
8
6
8
6
7
8
1
20
9
8
5
7
6
5
1
1
24
11
11
6
9
11
2
1
23
8
7
5
8
8
1
1
23
11
3
4
6
4
2
3
3
1
23
1...

output:

? 13 2
? 13 1
? 13 18
? 13 21
? 13 20
? 16 21
! 10 21
? 6 17
? 6 16
? 6 1
? 6 20
? 6 18
? 9 17
! 3 17
? 17 7
? 17 6
? 17 2
? 17 5
? 17 4
? 3 5
! 11 5
? 15 4
? 15 3
? 15 10
? 15 7
? 15 8
! 15 7
? 1 11
? 1 10
? 1 16
? 1 13
? 1 14
? 7 13
! 7 13
? 2 12
? 2 11
? 2 17
? 2 14
? 2 15
? 2 16
? 6 15
! 19 15
?...

result:

ok ok (1000 test cases)

Test #4:

score: 0
Accepted
time: 12ms
memory: 3584kb

input:

1000
25
9
10
7
10
10
4
1
25
5
6
3
2
1
2
1
25
7
8
7
8
6
7
1
1
25
6
7
6
3
4
5
1
26
12
12
6
9
8
8
10
1
26
13
7
6
6
4
6
5
1
1
26
11
10
4
3
5
1
1
27
12
11
5
2
1
1
25
9
10
5
6
5
4
7
1
27
9
8
4
6
4
3
1
1
27
11
12
7
11
12
3
1
27
3
2
6
4
3
3
1
26
5
4
6
6
5
1
1
25
10
11
7
9
9
8
7
1
27
13
8
9
7
9
7
8
1
1
25
10...

output:

? 14 1
? 14 25
? 14 7
? 14 4
? 14 2
? 22 1
! 6 1
? 9 21
? 9 20
? 9 2
? 9 24
? 9 25
? 9 1
! 9 25
? 18 5
? 18 4
? 18 11
? 18 8
? 18 6
? 18 7
? 23 6
! 23 6
? 13 25
? 13 24
? 13 6
? 13 3
? 13 4
? 15 3
! 11 3
? 1 14
? 1 13
? 1 21
? 1 17
? 1 19
? 1 18
? 8 18
! 20 18
? 2 15
? 22 9
? 22 8
? 22 2
? 22 6
? 22...

result:

ok ok (1000 test cases)

Test #5:

score: 0
Accepted
time: 8ms
memory: 3584kb

input:

1000
29
5
4
7
4
3
1
1
28
5
4
7
6
5
7
1
30
11
12
7
7
7
6
1
1
29
14
10
9
5
7
5
4
5
1
28
6
5
7
7
6
1
1
29
2
3
7
3
1
2
1
29
8
7
7
9
8
1
1
28
11
10
7
11
11
1
1
30
4
3
7
4
2
3
1
1
30
15
12
13
4
3
5
5
1
1
28
11
10
7
11
11
4
1
29
13
12
7
10
8
8
1
1
29
14
12
13
5
1
2
2
1
29
6
5
7
7
6
1
1
29
13
12
7
11
11
1
1...

output:

? 20 5
? 20 4
? 20 27
? 20 2
? 20 3
? 22 3
! 22 3
? 11 25
? 11 24
? 11 18
? 11 22
? 11 23
? 14 24
! 8 24
? 27 12
? 27 11
? 27 20
? 27 16
? 27 18
? 27 17
? 2 17
! 2 17
? 8 22
? 5 19
? 5 18
? 5 12
? 5 16
? 5 14
? 5 13
? 8 13
! 2 13
? 10 24
? 10 23
? 10 17
? 10 21
? 10 22
? 14 23
! 14 23
? 3 17
? 3 16
...

result:

ok ok (1000 test cases)

Test #6:

score: 0
Accepted
time: 11ms
memory: 3584kb

input:

1000
32
13
12
5
4
5
4
1
1
30
14
14
7
10
9
9
12
1
32
14
13
8
10
8
7
3
1
31
7
6
5
3
3
2
3
1
32
5
4
8
7
5
7
1
32
10
11
8
10
8
9
1
1
31
10
11
8
6
8
7
11
1
31
10
9
7
10
8
9
6
1
32
12
11
4
2
2
1
1
30
14
14
7
11
13
14
1
1
31
14
13
7
10
9
10
2
1
31
13
14
8
12
11
12
1
1
33
7
6
8
5
5
4
1
1
32
9
10
8
5
7
6
1
1...

output:

? 2 18
? 2 17
? 2 10
? 2 6
? 2 8
? 2 9
? 5 9
! 5 9
? 6 21
? 6 20
? 6 29
? 6 25
? 6 27
? 6 26
? 14 26
! 28 26
? 32 16
? 32 15
? 32 8
? 32 12
? 32 10
? 32 9
? 6 9
! 26 9
? 5 20
? 5 19
? 5 12
? 5 16
? 5 14
? 5 15
? 6 15
! 4 15
? 6 22
? 6 21
? 6 14
? 6 18
? 6 20
? 9 21
! 3 21
? 16 32
? 16 31
? 16 8
? 16...

result:

ok ok (1000 test cases)

Test #7:

score: 0
Accepted
time: 15ms
memory: 3584kb

input:

1000
34
16
15
7
4
5
4
2
1
33
9
10
9
5
7
6
9
1
33
11
12
3
3
1
2
1
34
7
8
8
9
7
6
1
1
34
13
14
8
13
11
12
1
1
35
15
16
9
14
16
16
3
1
34
8
7
8
8
6
7
10
1
34
16
16
8
12
11
11
1
1
34
16
16
8
12
11
11
12
1
33
9
10
7
5
5
4
7
1
33
15
14
8
11
9
9
1
1
34
16
16
7
3
2
3
5
1
33
12
11
4
4
4
3
5
1
34
12
13
8
13
1...

output:

? 34 17
? 34 16
? 34 8
? 34 4
? 34 6
? 34 5
? 3 5
! 31 5
? 19 2
? 19 1
? 19 10
? 19 6
? 19 8
? 19 7
? 23 6
! 15 6
? 31 14
? 31 13
? 31 22
? 31 26
? 31 24
? 31 25
! 31 24
? 27 10
? 27 9
? 27 19
? 27 14
? 27 12
? 27 11
? 32 11
! 32 11
? 17 34
? 17 33
? 17 9
? 17 4
? 17 2
? 17 3
? 27 2
! 27 2
? 19 1
? ...

result:

ok ok (1000 test cases)

Test #8:

score: 0
Accepted
time: 9ms
memory: 3584kb

input:

1000
36
17
16
8
4
6
6
1
1
36
18
3
4
8
3
1
2
1
36
13
14
9
9
9
8
15
1
36
15
14
6
4
7
7
4
1
36
9
8
4
5
3
2
3
1
1
36
10
11
9
12
10
9
1
1
35
15
16
6
2
3
3
1
1
36
9
8
9
5
7
6
1
1
36
8
7
7
4
4
3
5
1
36
16
15
7
2
2
3
1
1
36
13
12
9
9
7
8
6
1
36
4
5
9
4
2
3
1
1
36
17
17
8
3
1
1
36
9
10
9
11
9
8
1
1
35
12
11
...

output:

? 13 31
? 13 30
? 13 22
? 13 17
? 13 20
? 13 19
? 18 20
! 18 20
? 27 9
? 35 17
? 35 16
? 35 26
? 35 21
? 35 19
? 35 20
! 35 19
? 17 35
? 17 34
? 17 8
? 17 3
? 17 5
? 17 4
? 24 4
! 10 4
? 8 26
? 8 25
? 8 17
? 8 12
? 8 15
? 8 16
? 13 17
! 3 17
? 31 13
? 31 12
? 31 4
? 31 9
? 31 7
? 31 6
? 31 5
? 32 6
...

result:

ok ok (1000 test cases)

Test #9:

score: 0
Accepted
time: 14ms
memory: 3456kb

input:

1000
37
7
8
6
3
3
2
3
1
36
17
17
8
3
2
3
5
1
38
9
10
9
6
7
6
5
9
1
37
15
16
10
15
13
14
1
1
37
12
13
10
14
12
11
9
1
36
8
9
9
4
6
5
7
1
37
15
14
6
4
7
7
4
1
37
6
5
9
4
4
3
5
1
37
17
17
8
5
6
7
11
1
37
11
10
9
9
9
8
8
1
37
10
11
10
14
12
11
9
1
37
18
18
17
16
9
13
11
10
9
1
1
36
5
4
8
3
3
2
3
1
37
17...

output:

? 28 9
? 28 8
? 28 18
? 28 13
? 28 15
? 28 14
? 29 14
! 27 14
? 30 12
? 30 11
? 30 21
? 30 26
? 30 28
? 30 27
? 32 26
! 28 26
? 22 3
? 22 2
? 22 13
? 22 8
? 22 5
? 22 6
? 22 7
? 26 7
! 18 7
? 1 19
? 1 18
? 1 28
? 1 23
? 1 21
? 1 22
? 13 21
! 13 21
? 37 18
? 37 17
? 37 27
? 37 22
? 37 20
? 37 19
? 10...

result:

ok ok (1000 test cases)

Test #10:

score: 0
Accepted
time: 17ms
memory: 3456kb

input:

1000
39
13
12
9
14
11
12
7
1
38
18
17
9
13
12
13
2
1
38
13
14
9
14
11
12
1
1
39
18
18
10
15
16
15
16
1
1
38
15
14
7
10
8
7
6
1
1
39
10
11
8
5
5
4
1
1
39
15
16
10
12
13
12
11
13
1
38
18
17
8
4
6
5
4
1
1
39
13
14
10
15
15
14
1
1
39
11
10
9
12
9
10
1
1
39
8
9
10
9
6
7
1
1
38
18
18
8
4
7
8
15
1
39
11
12...

output:

? 35 15
? 35 14
? 35 5
? 35 10
? 35 13
? 35 12
? 6 13
! 25 13
? 7 26
? 7 25
? 7 16
? 7 21
? 7 19
? 7 20
? 19 21
! 33 21
? 5 24
? 5 23
? 5 34
? 5 29
? 5 26
? 5 27
? 15 26
! 15 26
? 27 7
? 27 6
? 27 17
? 27 12
? 27 9
? 27 10
? 27 11
? 2 10
! 2 10
? 16 35
? 16 34
? 16 25
? 16 30
? 16 28
? 16 27
? 16 26...

result:

ok ok (1000 test cases)

Test #11:

score: 0
Accepted
time: 22ms
memory: 3456kb

input:

1000
40
14
15
10
9
7
8
1
1
40
20
10
9
6
5
3
4
5
1
40
11
10
10
10
9
8
9
1
1
40
8
9
10
11
8
7
13
1
40
16
15
10
15
14
15
1
1
40
13
12
10
8
10
9
8
1
41
19
18
9
4
2
4
2
1
40
7
8
5
2
2
1
1
40
18
17
8
3
2
2
1
1
40
6
5
10
7
4
5
1
1
40
16
17
10
11
11
10
1
1
41
6
7
11
11
8
7
11
1
40
9
8
10
8
7
6
7
11
1
40
12
...

output:

? 20 40
? 20 39
? 20 10
? 20 5
? 20 7
? 20 8
? 26 7
! 26 7
? 39 19
? 14 34
? 14 33
? 14 24
? 14 29
? 14 27
? 14 26
? 16 27
! 12 27
? 26 6
? 26 5
? 26 36
? 26 1
? 26 4
? 26 3
? 26 2
? 33 3
! 33 3
? 20 40
? 20 39
? 20 10
? 20 5
? 20 2
? 20 1
? 26 1
! 14 1
? 10 30
? 10 29
? 10 20
? 10 25
? 10 28
? 10 2...

result:

ok ok (1000 test cases)

Test #12:

score: 0
Accepted
time: 12ms
memory: 3584kb

input:

1000
42
11
12
10
16
13
12
11
1
41
16
15
10
11
9
8
9
1
1
41
13
14
7
8
6
5
6
1
1
41
4
3
10
7
4
5
1
41
20
20
17
18
7
6
5
6
1
1
41
9
10
11
14
11
10
12
1
41
13
12
5
8
6
5
4
1
1
41
14
15
10
9
7
8
1
1
41
18
17
10
15
16
15
14
3
1
41
15
16
5
6
5
4
7
1
41
19
19
11
14
12
11
10
1
1
42
20
20
10
16
19
20
1
1
41
7...

output:

? 27 6
? 27 5
? 27 17
? 27 11
? 27 8
? 27 7
? 37 6
! 17 6
? 26 5
? 26 4
? 26 36
? 26 41
? 26 39
? 26 38
? 26 37
? 33 38
! 33 38
? 12 32
? 12 31
? 12 1
? 12 37
? 12 39
? 12 40
? 12 41
? 16 40
! 16 40
? 38 17
? 38 16
? 38 7
? 38 12
? 38 15
? 40 16
! 36 16
? 16 36
? 17 37
? 19 39
? 19 38
? 19 8
? 19 13...

result:

ok ok (1000 test cases)

Test #13:

score: 0
Accepted
time: 15ms
memory: 3584kb

input:

1000
43
5
6
10
4
3
2
3
3
1
42
18
19
10
13
10
9
10
17
1
43
11
12
6
6
3
4
1
1
43
1
2
11
6
3
2
1
43
21
14
13
9
9
6
7
1
1
43
10
11
5
5
2
3
1
1
43
19
20
11
14
14
15
13
1
43
21
20
19
10
16
18
18
1
1
42
13
14
10
16
13
12
11
1
42
20
20
9
5
7
6
5
9
1
42
7
8
10
6
5
4
5
1
1
43
9
10
11
10
7
8
1
1
42
15
16
10
16...

output:

? 22 43
? 22 42
? 22 11
? 22 5
? 22 2
? 22 3
? 22 4
? 23 3
! 21 3
? 28 7
? 28 6
? 28 18
? 28 12
? 28 15
? 28 16
? 28 17
? 36 16
! 20 16
? 19 40
? 19 39
? 19 8
? 19 2
? 19 5
? 19 6
? 21 5
! 21 5
? 14 35
? 14 34
? 14 3
? 14 40
? 14 37
? 14 36
! 14 35
? 1 22
? 35 13
? 35 12
? 35 2
? 35 8
? 35 5
? 35 4
...

result:

ok ok (1000 test cases)

Test #14:

score: 0
Accepted
time: 12ms
memory: 3584kb

input:

1000
44
18
19
7
5
4
3
4
1
1
44
5
6
11
8
5
4
1
1
43
11
12
11
12
9
10
15
1
43
12
11
1
5
3
2
1
44
17
16
11
12
14
13
1
1
44
16
15
5
5
4
4
3
1
1
44
19
20
8
5
5
4
5
1
1
44
20
21
9
5
8
8
9
1
1
43
20
19
9
5
7
7
2
1
43
19
18
10
14
11
10
9
3
1
44
17
18
11
14
15
14
13
1
1
44
20
21
9
5
8
8
9
15
1
44
19
18
11
14...

output:

? 4 26
? 4 25
? 4 37
? 4 43
? 4 40
? 4 41
? 4 42
? 6 41
! 6 41
? 26 4
? 26 3
? 26 15
? 26 9
? 26 6
? 26 5
? 29 5
! 29 5
? 1 22
? 1 21
? 1 33
? 1 27
? 1 24
? 1 25
? 9 24
! 36 24
? 18 39
? 18 38
? 18 28
? 18 23
? 18 26
? 18 27
! 18 28
? 29 7
? 29 6
? 29 40
? 29 2
? 29 43
? 29 1
? 40 2
! 40 2
? 3 25
? ...

result:

ok ok (1000 test cases)

Test #15:

score: 0
Accepted
time: 14ms
memory: 3584kb

input:

1000
45
19
20
12
14
11
12
20
1
45
22
13
12
11
14
11
12
10
1
45
18
17
7
5
6
6
5
5
1
45
16
15
9
11
8
7
8
7
1
45
11
10
4
6
3
2
3
1
1
45
2
3
12
7
4
3
3
1
45
19
20
12
14
11
10
11
19
1
45
4
3
11
5
2
3
3
1
44
19
18
8
5
7
7
6
1
1
45
11
10
10
6
7
5
6
1
1
44
20
21
9
5
6
7
11
1
45
16
17
5
6
8
6
9
1
44
22
16
17...

output:

? 15 37
? 15 36
? 15 3
? 15 42
? 15 45
? 15 1
? 25 45
! 5 45
? 28 5
? 22 44
? 22 43
? 22 33
? 22 39
? 22 42
? 22 41
? 32 42
! 12 42
? 9 31
? 9 30
? 9 20
? 9 14
? 9 17
? 9 19
? 9 18
? 13 18
! 5 18
? 38 15
? 38 14
? 38 4
? 38 10
? 38 7
? 38 6
? 38 5
? 44 6
! 32 6
? 1 23
? 1 22
? 1 12
? 1 18
? 1 15
? 1...

result:

ok ok (1000 test cases)

Test #16:

score: 0
Accepted
time: 12ms
memory: 3456kb

input:

1000
46
18
19
10
12
9
8
9
1
1
46
19
20
11
13
12
12
11
1
1
46
12
11
11
16
13
12
12
1
46
19
20
11
13
14
12
13
19
1
46
7
8
9
3
4
3
2
1
1
46
15
16
11
13
12
11
12
1
1
46
18
19
11
12
14
13
1
1
46
20
19
11
14
14
15
4
1
46
22
22
10
5
7
7
13
1
46
19
20
11
13
10
9
10
1
1
45
22
19
20
12
16
17
16
15
12
1
46
14
...

output:

? 24 1
? 24 46
? 24 13
? 24 7
? 24 10
? 24 11
? 24 12
? 31 11
! 31 11
? 19 42
? 19 41
? 19 8
? 19 2
? 19 5
? 19 3
? 19 4
? 29 4
! 29 4
? 17 40
? 17 39
? 17 28
? 17 34
? 17 37
? 17 38
? 27 39
! 7 39
? 22 45
? 22 44
? 22 11
? 22 5
? 22 8
? 22 6
? 22 7
? 33 6
! 11 6
? 19 42
? 19 41
? 19 8
? 19 2
? 19 4...

result:

ok ok (1000 test cases)

Test #17:

score: 0
Accepted
time: 49ms
memory: 3584kb

input:

1000
1000000000
499999999
499999999
250000000
374999999
312500000
343749999
328124999
320312500
324218749
322265624
321289062
320800782
321044922
320922853
320983887
320953370
320938111
320930483
320934297
320932391
320933345
320933822
320934060
320934178
320934119
320934089
320934074
320934067
3209...

output:

? 192981444 692981444
? 192981444 692981443
? 192981444 942981444
? 192981444 817981444
? 192981444 880481444
? 192981444 849231444
? 192981444 864856444
? 192981444 872668944
? 192981444 868762694
? 192981444 870715819
? 192981444 871692381
? 192981444 872180662
? 192981444 871936521
? 192981444 87...

result:

ok ok (1000 test cases)

Test #18:

score: 0
Accepted
time: 59ms
memory: 3584kb

input:

1000
1000000000
499999969
499999968
249999969
125000000
187499969
156249969
140624969
132812469
128906250
130859344
129882813
130371094
130615235
130737274
130676239
130645722
130630494
130638124
130641908
130640001
130639047
130638601
130638823
130638928
130638869
130638839
130638824
130638817
1306...

output:

? 272612058 772612058
? 272612058 772612057
? 272612058 522612058
? 272612058 397612058
? 272612058 460112058
? 272612058 428862058
? 272612058 413237058
? 272612058 405424558
? 272612058 401518308
? 272612058 403471433
? 272612058 402494871
? 272612058 402983152
? 272612058 403227293
? 272612058 40...

result:

ok ok (1000 test cases)

Test #19:

score: 0
Accepted
time: 60ms
memory: 3584kb

input:

1000
1000000000
391999249
391999248
250000000
266999249
204499249
218750001
203125001
196686749
199218751
197265626
196289063
196198468
196044922
196076398
196015363
196014404
196000105
196006774
196002959
196001052
196000098
195999629
195999859
195999740
195999680
195999650
195999635
195999628
1959...

output:

? 433073720 933073720
? 433073720 933073719
? 433073720 683073720
? 433073720 808073720
? 433073720 745573720
? 433073720 714323720
? 433073720 729948720
? 433073720 737761220
? 433073720 733854970
? 433073720 735808095
? 433073720 736784658
? 433073720 737272939
? 433073720 737028799
? 433073720 73...

result:

ok ok (1000 test cases)

Test #20:

score: 0
Accepted
time: 68ms
memory: 3584kb

input:

1000
1000000000
6089986
6089987
250000000
125000072
62500072
31250072
15625072
7812572
3906322
4136861
3160299
3418040
3173899
3051829
3099264
3068747
3053488
3045859
3048014
3046106
3045152
3045383
3045145
3045032
3045086
3045056
3045041
3045034
3045030
3045030
3045029
1
1
1000000000
403143431
4031...

output:

? 381712318 881712318
? 381712318 881712317
? 381712318 131712318
? 381712318 6712318
? 381712318 944212318
? 381712318 912962318
? 381712318 897337318
? 381712318 889524818
? 381712318 885618568
? 381712318 883665443
? 381712318 884642005
? 381712318 885130286
? 381712318 884886145
? 381712318 8847...

result:

ok ok (1000 test cases)

Test #21:

score: 0
Accepted
time: 65ms
memory: 3584kb

input:

1000
1000000000
288090905
288090904
250000000
324267917
261767917
256840905
246142917
249028405
245122155
244189792
244145593
243701510
243901453
243779383
243718348
243687830
243686251
243680201
243682436
243680528
243679574
243679725
243679487
243679454
243679428
243679424
243679413
243679416
2436...

output:

? 502539445 2539445
? 502539445 2539444
? 502539445 752539445
? 502539445 877539445
? 502539445 940039445
? 502539445 971289445
? 502539445 955664445
? 502539445 963476945
? 502539445 959570695
? 502539445 957617570
? 502539445 958594133
? 502539445 958105852
? 502539445 958349993
? 502539445 958227...

result:

ok ok (1000 test cases)

Test #22:

score: -100
Wrong Answer
time: 50ms
memory: 3456kb

input:

1000
999999999
499999999
499999998
499999997
249999998
124999999
187499998
156249999
171874998
164062499
167968749
169921873
168945312
169433592
169189452
169067382
169006347
168975829
168960571
168968201
168972015
168970109
168971062
168970586
168970824
168970705
168970645
168970615
168970600
16897...

output:

? 475249406 975249405
? 49647954 549647953
? 49647954 549647952
? 49647954 299647953
? 49647954 174647953
? 49647954 237147953
? 49647954 205897953
? 49647954 221522953
? 49647954 213710453
? 49647954 217616703
? 49647954 219569828
? 49647954 218593266
? 49647954 219081547
? 49647954 218837407
? 496...

result:

wrong answer Too many queries: 41 (test case 724)