QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#882656 | #9734. Identify Chord | rbtree | WA | 69ms | 3712kb | C++26 | 5.5kb | 2025-02-05 10:30:17 | 2025-02-05 10:30:17 |
Judging History
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;
auto ask = [&](int x, int y) {
cout << "? " << x + 1 << ' ' << y + 1 << endl;
cin >> x;
return x;
};
int x, y;
int d;
while (true) {
x = lib::rng(0, n - 1);
y = (x + n / 2) % n;
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: 3456kb
input:
2 6 3 2 2 1 1 1 1 1 4 1 1 1 1 1 1
output:
? 3 6 ? 4 1 ? 4 6 ? 4 3 ? 4 2 ? 4 2 ? 4 2 ! 4 2 ? 3 1 ? 3 4 ? 3 2 ? 3 1 ? 3 1 ! 3 1
result:
ok ok (2 test cases)
Test #2:
score: 0
Accepted
time: 15ms
memory: 3584kb
input:
1000 15 5 4 3 3 2 2 1 1 19 9 5 6 5 3 4 3 1 1 17 8 8 6 5 4 4 5 4 3 1 15 7 6 5 2 1 1 1 1 1 14 5 4 1 1 2 1 1 1 15 3 2 3 3 2 2 3 1 17 5 6 5 3 4 3 1 1 20 6 7 5 6 5 5 7 1 13 5 4 3 4 4 4 2 1 18 5 6 4 3 2 3 2 1 1 13 4 5 4 3 4 3 5 1 14 4 3 3 2 3 2 3 1 17 8 8 5 6 1 3 2 1 1 1 12 3 2 3 2 3 2 3 1 10 3 4 2 4 3 1 ...
output:
? 4 11 ? 4 10 ? 4 7 ? 4 9 ? 4 8 ? 4 8 ? 5 8 ! 5 8 ? 18 8 ? 1 10 ? 1 9 ? 1 15 ? 1 12 ? 1 13 ? 1 12 ? 3 12 ! 3 12 ? 16 7 ? 15 6 ? 14 5 ? 14 4 ? 14 1 ? 14 3 ? 14 2 ? 14 3 ? 17 3 ! 11 3 ? 9 1 ? 1 8 ? 1 7 ? 1 4 ? 1 2 ? 1 3 ? 1 3 ? 1 3 ! 1 3 ? 2 9 ? 2 8 ? 2 5 ? 2 3 ? 2 4 ? 2 5 ? 2 5 ! 2 5 ? 3 10 ? 3 9 ? 3...
result:
ok ok (1000 test cases)
Test #3:
score: 0
Accepted
time: 10ms
memory: 3584kb
input:
1000 21 9 9 6 7 6 5 5 1 1 22 10 9 4 2 4 4 2 1 20 5 6 5 5 4 4 7 1 22 8 9 5 7 7 6 6 1 1 21 6 7 5 4 3 4 3 5 1 21 10 10 8 9 3 3 4 3 5 1 24 5 4 3 2 1 2 1 1 1 22 10 10 5 7 6 6 6 10 1 21 7 8 6 5 4 5 4 1 1 23 8 9 2 3 1 2 1 1 1 21 5 6 6 5 4 4 7 1 24 9 10 3 3 2 3 2 1 1 20 9 9 4 2 3 3 3 5 1 24 12 11 10 5 2 1 1...
output:
? 17 6 ? 17 5 ? 17 11 ? 17 8 ? 17 9 ? 17 10 ? 17 10 ? 21 10 ! 21 10 ? 20 9 ? 20 8 ? 20 3 ? 20 22 ? 20 2 ? 20 3 ? 1 3 ! 17 3 ? 14 4 ? 14 3 ? 14 9 ? 14 6 ? 14 5 ? 14 5 ? 17 5 ! 11 5 ? 2 13 ? 2 12 ? 2 19 ? 2 16 ? 2 14 ? 2 15 ? 2 15 ? 7 15 ! 7 15 ? 15 4 ? 15 3 ? 15 9 ? 15 6 ? 15 7 ? 15 8 ? 15 7 ? 17 7 !...
result:
ok ok (1000 test cases)
Test #4:
score: 0
Accepted
time: 11ms
memory: 3456kb
input:
1000 25 9 10 7 10 10 9 4 1 25 12 9 8 6 8 8 7 7 4 1 25 6 7 2 3 2 1 1 1 1 25 9 10 7 8 8 7 7 1 1 26 12 12 6 10 11 11 11 4 1 26 13 7 8 6 10 8 7 7 1 26 11 12 6 8 6 7 6 11 1 27 13 13 12 11 5 2 1 1 1 1 1 25 9 10 7 10 10 9 4 1 27 10 11 7 9 9 8 8 8 1 27 10 9 6 7 5 6 5 1 1 27 2 3 7 3 1 2 1 1 1 26 11 12 6 8 8 ...
output:
? 14 1 ? 14 25 ? 14 7 ? 14 4 ? 14 2 ? 14 1 ? 22 1 ! 6 1 ? 5 17 ? 15 2 ? 15 1 ? 15 21 ? 15 24 ? 15 1 ? 15 25 ? 15 25 ? 21 25 ! 9 25 ? 6 18 ? 6 17 ? 6 24 ? 6 21 ? 6 22 ? 6 23 ? 6 23 ? 6 23 ! 6 23 ? 22 9 ? 22 8 ? 22 15 ? 22 12 ? 22 10 ? 22 11 ? 22 11 ? 3 11 ! 3 11 ? 4 17 ? 4 16 ? 4 24 ? 4 20 ? 4 18 ? 4...
result:
ok ok (1000 test cases)
Test #5:
score: 0
Accepted
time: 11ms
memory: 3584kb
input:
1000 29 10 11 3 4 5 4 3 1 1 28 3 4 7 6 4 3 5 1 30 15 7 6 7 5 5 4 4 7 1 29 5 6 8 8 6 5 9 1 28 6 5 5 3 3 2 2 1 1 29 6 5 7 5 5 4 4 7 1 29 8 7 7 5 5 4 4 1 1 28 11 12 4 2 2 1 1 1 1 30 15 4 3 7 6 4 3 3 1 1 30 10 9 4 6 4 3 3 5 1 28 9 10 7 6 8 7 6 11 1 29 13 12 7 11 12 12 12 1 1 29 12 13 5 1 2 2 1 1 1 29 6 ...
output:
? 1 15 ? 1 14 ? 1 22 ? 1 26 ? 1 24 ? 1 23 ? 1 22 ? 3 22 ! 3 22 ? 10 24 ? 10 23 ? 10 3 ? 10 27 ? 10 25 ? 10 24 ? 12 24 ! 8 24 ? 25 10 ? 5 20 ? 5 19 ? 5 12 ? 5 16 ? 5 18 ? 5 17 ? 5 17 ? 8 17 ! 2 17 ? 17 2 ? 17 1 ? 17 9 ? 17 5 ? 17 3 ? 17 2 ? 21 2 ! 13 2 ? 13 27 ? 13 26 ? 13 20 ? 13 24 ? 13 22 ? 13 23 ...
result:
ok ok (1000 test cases)
Test #6:
score: 0
Accepted
time: 12ms
memory: 3456kb
input:
1000 32 16 13 14 8 12 14 14 13 4 1 30 14 14 7 11 13 13 13 4 1 32 2 3 8 6 4 3 2 1 1 31 8 9 4 4 2 3 2 1 1 32 5 4 8 7 5 4 4 7 1 32 12 11 4 4 6 5 4 5 1 31 14 14 6 4 4 3 3 1 1 31 7 8 8 9 7 6 6 1 1 32 12 13 8 12 10 11 10 9 1 30 14 13 7 10 8 7 7 1 1 31 14 14 6 4 6 5 5 1 1 31 12 11 7 11 12 11 11 4 1 33 16 7...
output:
? 7 23 ? 21 5 ? 21 4 ? 21 13 ? 21 9 ? 21 7 ? 21 6 ? 21 5 ? 1 5 ! 9 5 ? 10 25 ? 10 24 ? 10 3 ? 10 29 ? 10 27 ? 10 26 ? 10 26 ? 22 26 ! 28 26 ? 25 9 ? 25 8 ? 25 17 ? 25 13 ? 25 11 ? 25 10 ? 25 9 ? 26 9 ! 26 9 ? 14 29 ? 14 28 ? 14 6 ? 14 2 ? 14 4 ? 14 5 ? 14 4 ? 15 4 ! 15 4 ? 6 22 ? 6 21 ? 6 14 ? 6 18 ...
result:
ok ok (1000 test cases)
Test #7:
score: 0
Accepted
time: 9ms
memory: 3584kb
input:
1000 34 10 9 8 10 8 9 8 1 1 33 9 10 9 5 7 6 5 9 1 33 11 12 7 7 5 6 5 9 1 34 17 15 14 6 4 6 7 6 3 1 34 9 10 8 5 7 6 5 9 1 35 15 16 9 11 9 10 9 15 1 34 14 15 8 10 10 9 9 1 1 34 10 9 5 6 4 3 4 3 5 1 34 16 15 7 4 5 4 4 1 1 33 16 14 13 6 4 4 5 4 3 1 33 15 14 8 11 9 9 9 1 1 34 16 16 7 4 6 6 6 11 1 33 8 7 ...
output:
? 24 7 ? 24 6 ? 24 32 ? 24 3 ? 24 5 ? 24 4 ? 24 5 ? 31 5 ! 31 5 ? 19 2 ? 19 1 ? 19 10 ? 19 6 ? 19 8 ? 19 7 ? 19 6 ? 23 6 ! 15 6 ? 2 18 ? 2 17 ? 2 26 ? 2 22 ? 2 24 ? 2 25 ? 2 24 ? 6 24 ! 31 24 ? 22 5 ? 3 20 ? 3 19 ? 3 11 ? 3 7 ? 3 9 ? 3 10 ? 3 11 ? 8 11 ! 32 11 ? 6 23 ? 6 22 ? 6 32 ? 6 27 ? 6 29 ? 6 ...
result:
ok ok (1000 test cases)
Test #8:
score: 0
Accepted
time: 10ms
memory: 3584kb
input:
1000 36 17 16 9 13 11 10 9 9 1 1 36 9 8 8 5 5 4 4 7 1 36 13 14 9 9 7 8 7 13 1 36 15 16 9 11 11 10 10 1 1 36 9 8 4 5 3 2 3 2 1 1 36 12 11 3 4 5 4 3 5 1 35 14 13 5 3 3 2 2 3 1 36 11 12 9 13 11 10 10 1 1 36 4 5 7 2 2 1 1 1 1 36 16 17 9 12 10 9 8 8 15 1 36 13 12 9 9 7 8 7 6 1 36 14 15 9 10 8 7 8 7 1 1 3...
output:
? 10 28 ? 10 27 ? 10 19 ? 10 24 ? 10 22 ? 10 21 ? 10 20 ? 10 20 ? 18 20 ! 18 20 ? 22 4 ? 22 3 ? 22 31 ? 22 36 ? 22 34 ? 22 35 ? 22 35 ? 25 35 ! 19 35 ? 16 34 ? 16 33 ? 16 7 ? 16 2 ? 16 4 ? 16 5 ? 16 4 ? 22 4 ! 10 4 ? 30 12 ? 30 11 ? 30 21 ? 30 16 ? 30 18 ? 30 17 ? 30 17 ? 3 17 ! 3 17 ? 31 13 ? 31 12...
result:
ok ok (1000 test cases)
Test #9:
score: 0
Accepted
time: 14ms
memory: 3584kb
input:
1000 37 11 12 4 7 5 4 3 3 1 1 36 17 17 8 3 2 2 2 3 1 38 9 10 9 6 7 6 5 5 9 1 37 11 10 8 7 5 6 5 1 1 37 12 13 3 4 1 2 1 1 1 36 14 15 5 4 5 4 4 1 1 37 7 6 6 3 3 2 2 3 1 37 13 14 8 9 7 6 7 6 1 1 37 18 16 15 9 14 14 13 13 1 1 37 9 10 6 5 3 4 3 1 1 37 9 8 9 7 7 6 6 1 1 37 18 17 16 8 4 6 6 6 1 1 36 3 4 9 ...
output:
? 25 6 ? 25 5 ? 25 15 ? 25 10 ? 25 12 ? 25 13 ? 25 14 ? 25 14 ? 27 14 ! 27 14 ? 29 11 ? 29 10 ? 29 20 ? 29 25 ? 29 27 ? 29 26 ? 29 26 ? 30 26 ! 28 26 ? 22 3 ? 22 2 ? 22 13 ? 22 8 ? 22 5 ? 22 6 ? 22 7 ? 22 7 ? 26 7 ! 18 7 ? 9 27 ? 9 26 ? 9 18 ? 9 23 ? 9 21 ? 9 20 ? 9 21 ? 13 21 ! 13 21 ? 27 8 ? 27 7 ...
result:
ok ok (1000 test cases)
Test #10:
score: 0
Accepted
time: 17ms
memory: 3584kb
input:
1000 39 8 7 9 11 8 7 7 1 1 38 8 9 9 9 6 7 6 11 1 38 9 8 9 12 9 8 8 1 1 39 13 14 3 4 1 2 1 1 1 38 15 16 9 14 13 12 13 12 11 1 39 10 9 9 9 8 7 8 7 10 1 39 15 16 10 14 13 12 13 12 11 1 38 18 17 9 14 16 15 15 15 1 1 39 14 15 10 15 12 13 12 10 1 39 16 15 9 14 14 15 14 4 1 39 18 18 10 13 11 12 11 1 1 38 1...
output:
? 7 26 ? 7 25 ? 7 16 ? 7 21 ? 7 24 ? 7 25 ? 7 25 ? 13 25 ! 13 25 ? 38 19 ? 38 18 ? 38 29 ? 38 24 ? 38 21 ? 38 22 ? 38 21 ? 5 21 ! 33 21 ? 8 27 ? 8 26 ? 8 17 ? 8 22 ? 8 25 ? 8 26 ? 8 26 ? 15 26 ! 15 26 ? 10 29 ? 10 28 ? 10 39 ? 10 5 ? 10 2 ? 10 3 ? 10 2 ? 10 2 ! 10 2 ? 37 18 ? 37 17 ? 37 28 ? 37 23 ?...
result:
ok ok (1000 test cases)
Test #11:
score: 0
Accepted
time: 11ms
memory: 3712kb
input:
1000 40 8 9 10 5 6 5 4 4 1 1 40 16 17 6 5 8 7 6 1 1 40 13 12 10 15 13 12 12 8 1 40 10 11 4 5 3 2 3 2 1 1 40 16 15 6 5 8 7 6 1 1 40 19 18 10 14 12 11 11 11 2 1 41 13 12 3 5 5 4 3 1 1 40 7 8 10 8 5 6 5 9 1 40 18 17 8 3 2 2 3 2 1 1 40 6 7 6 1 3 2 1 1 1 40 8 7 8 3 5 4 3 5 1 41 10 11 6 5 3 4 3 1 1 40 9 1...
output:
? 23 3 ? 23 2 ? 23 13 ? 23 8 ? 23 5 ? 23 6 ? 23 7 ? 23 7 ? 26 7 ! 26 7 ? 22 2 ? 22 1 ? 22 12 ? 22 17 ? 22 14 ? 22 13 ? 22 12 ? 27 12 ! 27 12 ? 14 34 ? 14 33 ? 14 24 ? 14 29 ? 14 32 ? 14 33 ? 14 33 ? 25 33 ! 3 33 ? 13 33 ? 13 32 ? 13 3 ? 13 38 ? 13 40 ? 13 1 ? 13 2 ? 13 1 ? 14 1 ! 14 1 ? 18 38 ? 18 3...
result:
ok ok (1000 test cases)
Test #12:
score: 0
Accepted
time: 13ms
memory: 3456kb
input:
1000 42 11 12 4 6 3 2 3 2 3 1 41 17 18 7 4 5 4 3 3 5 1 41 5 6 11 8 5 4 4 7 1 41 20 20 14 13 10 9 9 8 8 7 1 41 15 14 10 14 13 12 13 12 6 1 41 9 10 5 4 2 3 2 3 1 41 17 16 7 4 5 4 3 3 4 1 41 10 9 10 7 8 7 6 6 11 1 41 11 12 11 14 11 10 10 1 1 41 15 16 11 10 10 9 9 17 1 41 10 9 10 7 8 7 6 6 11 1 42 20 19...
output:
? 18 39 ? 18 38 ? 18 8 ? 18 2 ? 18 5 ? 18 6 ? 18 7 ? 18 6 ? 19 6 ! 17 6 ? 40 19 ? 40 18 ? 40 29 ? 40 34 ? 40 31 ? 40 32 ? 40 33 ? 40 33 ? 1 33 ! 38 33 ? 19 39 ? 19 38 ? 19 8 ? 19 3 ? 19 41 ? 19 40 ? 19 40 ? 22 40 ! 16 40 ? 27 6 ? 27 6 ? 2 22 ? 2 21 ? 2 12 ? 2 17 ? 2 15 ? 2 16 ? 2 16 ? 9 16 ! 36 16 ?...
result:
ok ok (1000 test cases)
Test #13:
score: 0
Accepted
time: 20ms
memory: 3584kb
input:
1000 43 10 11 11 9 8 7 8 7 1 1 42 20 20 9 4 2 3 2 2 1 1 43 12 11 7 7 4 5 4 7 1 43 18 19 11 13 10 9 10 9 1 1 43 15 16 11 10 13 11 10 17 1 43 19 18 8 5 8 7 7 3 1 43 18 17 7 5 7 6 6 1 1 43 20 19 9 5 7 7 7 1 1 42 19 18 8 5 6 5 4 4 3 1 42 20 19 10 16 18 17 16 16 1 1 42 19 20 10 14 11 10 11 10 1 1 43 10 9...
output:
? 40 18 ? 40 17 ? 40 29 ? 40 23 ? 40 20 ? 40 21 ? 40 22 ? 40 21 ? 3 21 ! 3 21 ? 19 40 ? 19 39 ? 19 9 ? 19 14 ? 19 17 ? 19 15 ? 19 16 ? 19 16 ? 20 16 ! 20 16 ? 8 29 ? 8 28 ? 8 18 ? 8 24 ? 8 21 ? 8 20 ? 8 21 ? 11 21 ! 5 21 ? 27 5 ? 27 4 ? 27 16 ? 27 10 ? 27 13 ? 27 14 ? 27 15 ? 27 14 ? 35 14 ! 35 14 ?...
result:
ok ok (1000 test cases)
Test #14:
score: 0
Accepted
time: 17ms
memory: 3712kb
input:
1000 44 22 20 21 11 17 18 17 18 17 1 1 44 22 17 16 10 12 9 8 9 8 6 1 43 14 13 3 5 5 4 3 5 1 43 17 18 6 5 4 3 4 3 1 1 44 17 18 11 12 11 11 10 10 19 1 44 16 15 11 11 12 10 11 10 1 1 44 21 20 11 17 19 18 17 17 2 1 44 14 13 7 9 6 5 6 5 9 1 43 8 7 9 3 6 4 3 1 1 43 8 9 9 3 6 4 3 1 1 44 15 16 11 14 13 12 1...
output:
? 23 1 ? 25 3 ? 25 2 ? 25 14 ? 25 8 ? 25 5 ? 25 6 ? 25 7 ? 25 6 ? 41 6 ! 41 6 ? 39 17 ? 36 14 ? 36 13 ? 36 3 ? 36 9 ? 36 6 ? 36 5 ? 36 4 ? 36 5 ? 43 5 ! 29 5 ? 26 4 ? 26 3 ? 26 36 ? 26 31 ? 26 34 ? 26 35 ? 26 36 ? 28 36 ! 24 36 ? 26 4 ? 26 3 ? 26 15 ? 26 20 ? 26 17 ? 26 18 ? 26 19 ? 26 18 ? 28 18 ! ...
result:
ok ok (1000 test cases)
Test #15:
score: 0
Accepted
time: 16ms
memory: 3456kb
input:
1000 45 18 17 9 13 10 9 8 8 1 1 45 9 10 12 12 9 8 8 15 1 45 22 11 12 8 6 5 5 4 4 7 1 45 17 18 8 12 9 8 7 7 1 1 45 12 13 12 7 10 8 7 13 1 45 4 5 11 5 2 3 2 1 1 45 18 17 11 13 12 12 11 11 1 1 45 14 15 12 9 10 8 9 8 1 1 44 19 20 11 17 20 20 19 1 1 45 12 13 3 7 4 3 2 2 3 1 44 20 19 11 17 20 19 19 1 1 45...
output:
? 38 15 ? 38 14 ? 38 4 ? 38 10 ? 38 7 ? 38 6 ? 38 5 ? 38 5 ? 45 5 ! 45 5 ? 19 41 ? 19 40 ? 19 7 ? 19 1 ? 19 43 ? 19 42 ? 19 42 ? 26 42 ! 12 42 ? 35 12 ? 21 43 ? 21 42 ? 21 9 ? 21 3 ? 21 6 ? 21 4 ? 21 5 ? 21 5 ? 24 5 ! 18 5 ? 45 22 ? 45 21 ? 45 33 ? 45 27 ? 45 30 ? 45 31 ? 45 32 ? 45 32 ? 6 32 ! 6 32...
result:
ok ok (1000 test cases)
Test #16:
score: 0
Accepted
time: 14ms
memory: 3584kb
input:
1000 46 20 19 11 14 13 13 12 12 4 1 46 3 2 11 7 4 2 3 2 1 1 46 14 15 4 8 5 4 3 3 1 1 46 19 20 11 13 14 14 13 17 1 46 5 4 11 9 6 4 5 4 1 1 46 7 8 11 13 10 8 7 13 1 46 8 7 11 12 9 7 8 7 13 1 46 23 8 9 11 10 7 7 6 6 11 1 46 22 22 10 4 2 3 2 2 3 1 46 19 18 11 13 12 12 11 11 5 1 45 19 20 12 14 11 12 11 2...
output:
? 42 19 ? 42 18 ? 42 7 ? 42 13 ? 42 10 ? 42 12 ? 42 11 ? 42 11 ? 7 11 ! 31 11 ? 28 5 ? 28 4 ? 28 39 ? 28 45 ? 28 2 ? 28 4 ? 28 3 ? 28 4 ? 29 4 ! 29 4 ? 5 28 ? 5 27 ? 5 40 ? 5 34 ? 5 37 ? 5 38 ? 5 39 ? 5 39 ? 7 39 ! 7 39 ? 23 46 ? 23 45 ? 23 12 ? 23 6 ? 23 9 ? 23 7 ? 23 6 ? 35 6 ! 11 6 ? 44 21 ? 44 2...
result:
ok ok (1000 test cases)
Test #17:
score: 0
Accepted
time: 49ms
memory: 3584kb
input:
1000 1000000000 499999999 499999998 249999999 125000000 187499999 156249999 140625000 148437500 152343750 154296874 153320313 153808593 153564454 153686523 153625489 153656007 153671265 153663637 153667451 153665545 153666499 153666976 153667214 153667333 153667393 153667422 153667408 153667416 1536...
output:
? 718379963 218379963 ? 718379963 218379962 ? 718379963 968379963 ? 718379963 843379963 ? 718379963 905879963 ? 718379963 874629963 ? 718379963 859004963 ? 718379963 866817463 ? 718379963 870723713 ? 718379963 872676838 ? 718379963 871700276 ? 718379963 872188557 ? 718379963 871944417 ? 718379963 87...
result:
ok ok (1000 test cases)
Test #18:
score: 0
Accepted
time: 53ms
memory: 3456kb
input:
1000 1000000000 499999969 499999968 249999969 125000000 187499969 156249969 140625000 148437469 144531219 142578094 141601563 142089813 141845704 141967743 141906739 141937226 141921967 141914338 141910554 141912462 141913416 141913893 141914131 141914219 141914176 141914190 141914175 141914168 1419...
output:
? 261336706 761336706 ? 261336706 761336705 ? 261336706 511336706 ? 261336706 386336706 ? 261336706 448836706 ? 261336706 417586706 ? 261336706 401961706 ? 261336706 409774206 ? 261336706 405867956 ? 261336706 403914831 ? 261336706 402938269 ? 261336706 403426550 ? 261336706 403182410 ? 261336706 40...
result:
ok ok (1000 test cases)
Test #19:
score: 0
Accepted
time: 41ms
memory: 3584kb
input:
1000 1000000000 390661579 390661580 250000000 265661579 203161579 218750001 203125001 195349079 199218751 197265626 196289063 195800782 195556641 195434571 195373536 195343018 195333821 195335388 195331573 195331914 195330961 195331096 195330857 195330842 195330797 195330813 195330798 195330791 1953...
output:
? 541743307 41743307 ? 541743307 41743306 ? 541743307 291743307 ? 541743307 166743307 ? 541743307 229243307 ? 541743307 260493307 ? 541743307 244868307 ? 541743307 237055807 ? 541743307 240962057 ? 541743307 239008932 ? 541743307 238032369 ? 541743307 237544088 ? 541743307 237299947 ? 541743307 2371...
result:
ok ok (1000 test cases)
Test #20:
score: 0
Accepted
time: 69ms
memory: 3584kb
input:
1000 1000000000 341330514 341330513 250000000 216330514 187500072 185080514 171875072 177268014 173361764 171408639 170898509 170920358 170676218 170776438 170715403 170684885 170669626 170668589 170665811 170666682 170665729 170665334 170665491 170665372 170665312 170665304 170665297 170665296 1706...
output:
? 55422567 555422567 ? 55422567 555422566 ? 55422567 305422567 ? 55422567 430422567 ? 55422567 367922567 ? 55422567 399172567 ? 55422567 383547567 ? 55422567 391360067 ? 55422567 387453817 ? 55422567 385500692 ? 55422567 384524130 ? 55422567 385012411 ? 55422567 384768271 ? 55422567 384646201 ? 5542...
result:
ok ok (1000 test cases)
Test #21:
score: 0
Accepted
time: 51ms
memory: 3584kb
input:
1000 1000000000 288090905 288090904 250000000 178267439 225590905 194340905 178715905 170903405 174361189 172408064 171431501 170943220 170699079 170781335 170720300 170689783 170683820 170682154 170680005 170680247 170679293 170679528 170679289 170679174 170679229 170679199 170679184 170679177 1706...
output:
? 575539684 75539684 ? 575539684 75539683 ? 575539684 825539684 ? 575539684 950539684 ? 575539684 13039684 ? 575539684 981789684 ? 575539684 966164684 ? 575539684 958352184 ? 575539684 954445934 ? 575539684 956399059 ? 575539684 957375622 ? 575539684 957863903 ? 575539684 958108044 ? 575539684 95823...
result:
ok ok (1000 test cases)
Test #22:
score: -100
Wrong Answer
time: 7ms
memory: 3584kb
input:
1000 999999999 499999998 499999997 249999999 374999998 312499998 281249998 265624998 257812498 253906248 251953123 250976562 251464842 251220702 251098633 251159668 251190186 251205444 251197816 251201631 251203537 251202585 251203061 251202823 251202705 251202765 251202795 251202810 251202817 25120...
output:
? 967415726 467415726 ? 967415726 467415725 ? 967415726 217415726 ? 967415726 342415726 ? 967415726 279915726 ? 967415726 248665726 ? 967415726 233040726 ? 967415726 225228226 ? 967415726 221321976 ? 967415726 219368851 ? 967415726 218392289 ? 967415726 218880570 ? 967415726 218636430 ? 967415726 21...
result:
wrong answer Too many queries: 41 (test case 125)