QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#623287 | #8239. Mysterious Tree | FXLY_awa# | AC ✓ | 5ms | 3924kb | C++20 | 3.3kb | 2024-10-09 11:06:59 | 2024-10-09 11:06:59 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define int long long
#define itn int
#define endl '\n'
#define Endl endl
#define ednl endl
#define al(a) (a).begin(),(a).end()
#define all(a) (a).begin()+1,(a).end()
#define debug(x) {cerr<<"ss:"<<x<<endl;}
#define qdebug(x) {cerr<<"ss:";for(auto i:x)cout<<i<<" ";cout<<endl;}
#define lowbit(x) (x&-x)
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define fs first
#define sc second
constexpr long long maxlonglong = 9223372036854775807; //9e18
constexpr int maxint = 2147483647; //2e9
constexpr int INF = 0x7f7f7f7f7f7f7f7f; //2139062143^2
constexpr int M = 1e9 + 7;
constexpr int mod = 998244353;
constexpr int hs = 0x1F351F35; // good hash number.
const double pi = acos(-1.0);
const double eps = 1e-15;
vector<int> input(int n){vector<int> a(n+1);for(int i=1;i<=n;i++)cin>>a[i];return a;}
mt19937_64 rnd(time(0));
constexpr int N=1231564;
int ask(int u,int v){
int res;
cout<<"? "<<u<<" "<<v<<endl;
cout.flush();
cin>>res;
return res;
}
inline void solve(){
int n;cin>>n;
int t=0;
for(int i=1;i<=n/2;i++){
if(ask(i,n+1-i)){
t=i;
break;
}
}
if((!t)&&n%2){
if(ask(1,(n+1)/2)){
t=(n+1)/2;
}
}
if(t==0){
cout<<"! "<<1<<endl;
}
else{
int u=t,v;
if(u==(n+1)/2&&n%2)v=1;
else v=(n+1)-u;
for(int i=1;i<=n;i++)if(u!=i&&v!=i){
t=i;
break;
}
if(ask(u,t)){
int x;
for(int i=1;i<=n;i++)if(u!=i&&v!=i&&t!=i){
x=i;
break;
}
if(ask(u,x)){
cout<<"! "<<2<<endl;
}
else cout<<"! "<<1<<endl;
}
else if(ask(v,t)){
int x;
for(int i=1;i<=n;i++)if(u!=i&&v!=i&&t!=i){
x=i;
break;
}
if(ask(v,x)){
cout<<"! "<<2<<endl;
}
else cout<<"! "<<1<<endl;
}
else cout<<"! "<<1<<endl;
}
cout.flush();
}
signed main()
{
//freopen("E:\work tool\code document\data\input.in", "r", stdin);
//freopen("E:\work tool\code document\data\output.out", "w", stdout);
// ios::sync_with_stdio(false);
// ios_base::sync_with_stdio(false);
// cin.tie(0);
// cout.tie(0); //关闭同步 如果使用 则不要使用<cstdio>
cout << fixed << setprecision(20);
int T=1;
cin>>T;
while(T--){
solve();
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3652kb
input:
2 4 0 1 1 0 4 0 1 0 1 1
output:
? 1 4 ? 2 3 ? 2 1 ? 2 4 ! 1 ? 1 4 ? 2 3 ? 2 1 ? 3 1 ? 3 4 ! 2
result:
ok Correct (2 test cases)
Test #2:
score: 0
Accepted
time: 1ms
memory: 3668kb
input:
87 13 0 1 0 1 1 15 0 0 1 0 1 1 7 1 0 1 1 15 1 0 0 19 0 0 0 0 0 0 0 0 1 0 1 1 20 1 0 0 7 0 1 0 1 1 20 0 0 0 0 0 1 0 1 1 17 0 0 0 0 0 0 0 0 0 11 0 0 0 0 1 0 0 14 1 0 0 13 0 0 0 0 0 0 0 18 0 0 0 0 0 0 1 0 1 1 14 0 0 0 1 1 1 20 0 0 0 0 0 0 1 1 0 11 1 0 0 11 0 1 0 1 0 8 0 0 1 1 1 7 0 0 0 1 0 1 0 9 1 0 0 ...
output:
? 1 13 ? 2 12 ? 2 1 ? 12 1 ? 12 3 ! 2 ? 1 15 ? 2 14 ? 3 13 ? 3 1 ? 13 1 ? 13 2 ! 2 ? 1 7 ? 1 2 ? 7 2 ? 7 3 ! 2 ? 1 15 ? 1 2 ? 15 2 ! 1 ? 1 19 ?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? 20 2 ! 2 ? 1 70 ? 2 69 ? 3 68 ...
result:
ok Correct (5 test cases)
Test #6:
score: 0
Accepted
time: 1ms
memory: 3664kb
input:
7 147 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 801 0 0 0 0 0 1 0 0 27 0 0 0 0 0 0 0 0 0 0 1 0 1 1 13 0 0 1 0 1 1 4 1 0 1 1 4 1 0 0 4 0 1 1 1
output:
? 1 147 ? 2 146 ? 3 145 ? 4 144 ? 5 143 ? 6 142 ? 7 141 ? 8 140 ? 9 139 ? 10 138 ? 11 137 ? 12 136 ? 13 135 ? 14 134 ? 15 133 ? 16 132 ? 17 131 ? 18 130 ? 19 129 ? 20 128 ? 21 127 ? 22 126 ? 23 125 ? 24 124 ? 25 123 ? 26 122 ? 27 121 ? 28 120 ? 29 119 ? 30 118 ? 31 117 ? 32 116 ? 33 115 ? 34 114 ? 3...
result:
ok Correct (7 test cases)
Test #7:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
160 4 0 0 9 0 0 0 0 0 7 0 0 0 1 1 1 4 0 0 9 0 0 0 0 1 1 1 9 0 0 0 0 1 1 1 6 0 0 1 0 1 1 7 0 0 0 1 1 1 4 0 0 6 0 0 1 0 1 1 4 0 0 5 0 0 1 1 1 7 0 0 0 1 1 1 4 0 1 0 1 1 7 0 0 0 0 6 0 0 0 9 0 0 0 0 0 9 0 0 0 0 0 4 0 0 4 0 0 4 0 0 5 0 0 1 1 1 9 0 0 0 0 0 6 0 0 0 9 0 0 0 0 0 5 0 0 1 1 1 6 0 0 0 5 0 0 0 9 ...
output:
? 1 4 ? 2 3 ! 1 ? 1 9 ? 2 8 ? 3 7 ? 4 6 ? 1 5 ! 1 ? 1 7 ? 2 6 ? 3 5 ? 1 4 ? 4 2 ? 4 3 ! 2 ? 1 4 ? 2 3 ! 1 ? 1 9 ? 2 8 ? 3 7 ? 4 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2 16 ? 3 15 ? 4 14 ? 5 13 ? 6 12 ? 7 11 ? 8 10 ? 1 9 ? 9 2 ? 9 3 ! 2 ? 1 13 ? 2 12 ? 3 11 ? 4 10 ? 5 9 ? 6 8 ? 1 7 ! 1 ? 1 11 ? 2 10 ? 3 9 ? 4 8 ? 5 7 ? 1 6 ? 6 2 ? 6 3 ! 2 ...
result:
ok Correct (84 test cases)
Test #11:
score: 0
Accepted
time: 5ms
memory: 3604kb
input:
23 27 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 12 0 0 0 0 0 0 93 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 6 0 0 0 59 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
? 1 27 ? 2 26 ? 3 25 ? 4 24 ? 5 23 ? 6 22 ? 7 21 ? 8 20 ? 9 19 ? 10 18 ? 11 17 ? 12 16 ? 13 15 ? 1 14 ? 14 2 ? 14 3 ! 2 ? 1 12 ? 2 11 ? 3 10 ? 4 9 ? 5 8 ? 6 7 ! 1 ? 1 93 ? 2 92 ? 3 91 ? 4 90 ? 5 89 ? 6 88 ? 7 87 ? 8 86 ? 9 85 ? 10 84 ? 11 83 ? 12 82 ? 13 81 ? 14 80 ? 15 79 ? 16 78 ? 17 77 ? 18 76 ? ...
result:
ok Correct (23 test cases)
Test #12:
score: 0
Accepted
time: 3ms
memory: 3592kb
input:
20 39 0 0 1 0 1 1 44 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 85 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 35 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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38 ? 33 37 ? 34 36 ? 1 35 ! 1 ? 1 189 ? 2 188 ? 3 187 ? ...
result:
ok Correct (9 test cases)
Test #14:
score: 0
Accepted
time: 3ms
memory: 3624kb
input:
6 243 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 181 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
? 1 243 ? 2 242 ? 3 241 ? 4 240 ? 5 239 ? 6 238 ? 7 237 ? 8 236 ? 9 235 ? 10 234 ? 11 233 ? 12 232 ? 13 231 ? 14 230 ? 15 229 ? 16 228 ? 17 227 ? 18 226 ? 19 225 ? 20 224 ? 21 223 ? 22 222 ? 23 221 ? 24 220 ? 25 219 ? 26 218 ? 27 217 ? 28 216 ? 29 215 ? 30 214 ? 31 213 ? 32 212 ? 33 211 ? 34 210 ? 3...
result:
ok Correct (6 test cases)
Test #15:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
4 613 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
? 1 613 ? 2 612 ? 3 611 ? 4 610 ? 5 609 ? 6 608 ? 7 607 ? 8 606 ? 9 605 ? 10 604 ? 11 603 ? 12 602 ? 13 601 ? 14 600 ? 15 599 ? 16 598 ? 17 597 ? 18 596 ? 19 595 ? 20 594 ? 21 593 ? 22 592 ? 23 591 ? 24 590 ? 25 589 ? 26 588 ? 27 587 ? 28 586 ? 29 585 ? 30 584 ? 31 583 ? 32 582 ? 33 581 ? 34 580 ? 3...
result:
ok Correct (4 test cases)
Test #16:
score: 0
Accepted
time: 4ms
memory: 3692kb
input:
146 6 1 1 0 9 1 1 0 4 1 1 1 9 1 1 1 7 1 1 0 6 1 1 1 5 1 1 0 9 1 1 1 7 1 1 0 4 1 1 1 9 1 1 1 5 1 1 1 4 1 1 1 9 1 1 1 5 1 1 0 4 1 1 1 9 1 1 0 6 1 1 1 5 1 1 0 9 1 1 1 6 1 1 1 5 1 1 0 7 1 1 0 5 1 1 1 5 1 1 1 5 1 1 1 7 1 1 1 4 1 1 0 4 1 1 1 6 1 1 0 8 1 1 0 7 1 1 0 5 1 1 0 9 1 1 0 7 1 1 1 8 1 1 0 6 1 1 1 ...
output:
? 1 6 ? 1 2 ? 1 3 ! 1 ? 1 9 ? 1 2 ? 1 3 ! 1 ? 1 4 ? 1 2 ? 1 3 ! 2 ? 1 9 ? 1 2 ? 1 3 ! 2 ? 1 7 ? 1 2 ? 1 3 ! 1 ? 1 6 ? 1 2 ? 1 3 ! 2 ? 1 5 ? 1 2 ? 1 3 ! 1 ? 1 9 ? 1 2 ? 1 3 ! 2 ? 1 7 ? 1 2 ? 1 3 ! 1 ? 1 4 ? 1 2 ? 1 3 ! 2 ? 1 9 ? 1 2 ? 1 3 ! 2 ? 1 5 ? 1 2 ? 1 3 ! 2 ? 1 4 ? 1 2 ? 1 3 ! 2 ? 1 9 ? 1 2 ? ...
result:
ok Correct (146 test cases)
Test #17:
score: 0
Accepted
time: 2ms
memory: 3916kb
input:
117 4 1 1 1 4 1 1 1 12 1 1 1 7 1 1 1 12 1 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3 33 ? 4 32 ? 5 31 ? 5 1 ? 31 1 ! 1 ? 1 122 ? 1 2 ? 1 3 ! 2 ? 1 167 ? 2 166 ? 3 165 ? 4 164 ? 5 163 ? 6 162 ? 7 161 ? 8 160 ? 9 159 ? 10 158 ? 11 157 ? 12 156 ? 13 155 ? 14 154 ? 15 153 ? 16 152 ? 17 151 ? 18 150 ? 19 149 ? 20 148 ? 21 147 ? 22 146 ? 23 145 ? 24 144 ? 25 143 ? 26 142...
result:
ok Correct (9 test cases)
Test #27:
score: 0
Accepted
time: 1ms
memory: 3668kb
input:
8 481 0 0 0 0 1 0 1 1 165 0 0 0 0 1 0 1 1 11 0 0 1 0 0 145 0 1 1 0 34 1 0 0 148 1 1 1 12 1 1 0 4 0 1 1 1
output:
? 1 481 ? 2 480 ? 3 479 ? 4 478 ? 5 477 ? 5 1 ? 477 1 ? 477 2 ! 2 ? 1 165 ? 2 164 ? 3 163 ? 4 162 ? 5 161 ? 5 1 ? 161 1 ? 161 2 ! 2 ? 1 11 ? 2 10 ? 3 9 ? 3 1 ? 9 1 ! 1 ? 1 145 ? 2 144 ? 2 1 ? 2 3 ! 1 ? 1 34 ? 1 2 ? 34 2 ! 1 ? 1 148 ? 1 2 ? 1 3 ! 2 ? 1 12 ? 1 2 ? 1 3 ! 1 ? 1 4 ? 2 3 ? 2 1 ? 2 4 ! 2
result:
ok Correct (8 test cases)
Test #28:
score: 0
Accepted
time: 1ms
memory: 3924kb
input:
10 510 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 222 1 1 0 115 1 1 0 20 1 1 1 37 1 1 1 10 0 1 0 0 19 1 1 1 22 0 1 0 0 36 1 1 1 7 0 0 0 1 1 0
output:
? 1 510 ? 2 509 ? 3 508 ? 4 507 ? 5 506 ? 6 505 ? 7 504 ? 8 503 ? 9 502 ? 10 501 ? 11 500 ? 12 499 ? 13 498 ? 13 1 ? 498 1 ! 1 ? 1 222 ? 1 2 ? 1 3 ! 1 ? 1 115 ? 1 2 ? 1 3 ! 1 ? 1 20 ? 1 2 ? 1 3 ! 2 ? 1 37 ? 1 2 ? 1 3 ! 2 ? 1 10 ? 2 9 ? 2 1 ? 9 1 ! 1 ? 1 19 ? 1 2 ? 1 3 ! 2 ? 1 22 ? 2 21 ? 2 1 ? 21 1 ...
result:
ok Correct (10 test cases)
Test #29:
score: 0
Accepted
time: 4ms
memory: 3668kb
input:
1 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
? 1 1000 ? 2 999 ? 3 998 ? 4 997 ? 5 996 ? 6 995 ? 7 994 ? 8 993 ? 9 992 ? 10 991 ? 11 990 ? 12 989 ? 13 988 ? 14 987 ? 15 986 ? 16 985 ? 17 984 ? 18 983 ? 19 982 ? 20 981 ? 21 980 ? 22 979 ? 23 978 ? 24 977 ? 25 976 ? 26 975 ? 27 974 ? 28 973 ? 29 972 ? 30 971 ? 31 970 ? 32 969 ? 33 968 ? 34 967 ? ...
result:
ok Correct (1 test case)
Test #30:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
2 500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
? 1 500 ? 2 499 ? 3 498 ? 4 497 ? 5 496 ? 6 495 ? 7 494 ? 8 493 ? 9 492 ? 10 491 ? 11 490 ? 12 489 ? 13 488 ? 14 487 ? 15 486 ? 16 485 ? 17 484 ? 18 483 ? 19 482 ? 20 481 ? 21 480 ? 22 479 ? 23 478 ? 24 477 ? 25 476 ? 26 475 ? 27 474 ? 28 473 ? 29 472 ? 30 471 ? 31 470 ? 32 469 ? 33 468 ? 34 467 ? 3...
result:
ok Correct (2 test cases)
Test #31:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
4 250 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 250 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
? 1 250 ? 2 249 ? 3 248 ? 4 247 ? 5 246 ? 6 245 ? 7 244 ? 8 243 ? 9 242 ? 10 241 ? 11 240 ? 12 239 ? 13 238 ? 14 237 ? 15 236 ? 16 235 ? 17 234 ? 18 233 ? 19 232 ? 20 231 ? 21 230 ? 22 229 ? 23 228 ? 24 227 ? 25 226 ? 26 225 ? 27 224 ? 28 223 ? 29 222 ? 30 221 ? 31 220 ? 32 219 ? 33 218 ? 34 217 ? 3...
result:
ok Correct (4 test cases)
Test #32:
score: 0
Accepted
time: 2ms
memory: 3728kb
input:
1 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
? 1 1000 ? 2 999 ? 3 998 ? 4 997 ? 5 996 ? 6 995 ? 7 994 ? 8 993 ? 9 992 ? 10 991 ? 11 990 ? 12 989 ? 13 988 ? 14 987 ? 15 986 ? 16 985 ? 17 984 ? 18 983 ? 19 982 ? 20 981 ? 21 980 ? 22 979 ? 23 978 ? 24 977 ? 25 976 ? 26 975 ? 27 974 ? 28 973 ? 29 972 ? 30 971 ? 31 970 ? 32 969 ? 33 968 ? 34 967 ? ...
result:
ok Correct (1 test case)
Test #33:
score: 0
Accepted
time: 1ms
memory: 3892kb
input:
1 1000 1 1 1
output:
? 1 1000 ? 1 2 ? 1 3 ! 2
result:
ok Correct (1 test case)
Test #34:
score: 0
Accepted
time: 1ms
memory: 3656kb
input:
1 1000 0 0 0 0 1 0 1 1
output:
? 1 1000 ? 2 999 ? 3 998 ? 4 997 ? 5 996 ? 5 1 ? 996 1 ? 996 2 ! 2
result:
ok Correct (1 test case)
Test #35:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
2 500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
? 1 500 ? 2 499 ? 3 498 ? 4 497 ? 5 496 ? 6 495 ? 7 494 ? 8 493 ? 9 492 ? 10 491 ? 11 490 ? 12 489 ? 13 488 ? 14 487 ? 15 486 ? 16 485 ? 17 484 ? 18 483 ? 19 482 ? 20 481 ? 21 480 ? 22 479 ? 23 478 ? 24 477 ? 25 476 ? 26 475 ? 27 474 ? 28 473 ? 29 472 ? 30 471 ? 31 470 ? 32 469 ? 33 468 ? 34 467 ? 3...
result:
ok Correct (2 test cases)
Test #36:
score: 0
Accepted
time: 1ms
memory: 3660kb
input:
2 500 1 1 1 500 1 1 0
output:
? 1 500 ? 1 2 ? 1 3 ! 2 ? 1 500 ? 1 2 ? 1 3 ! 1
result:
ok Correct (2 test cases)
Test #37:
score: 0
Accepted
time: 0ms
memory: 3888kb
input:
2 500 1 1 1 500 0 1 0 1 1
output:
? 1 500 ? 1 2 ? 1 3 ! 2 ? 1 500 ? 2 499 ? 2 1 ? 499 1 ? 499 3 ! 2
result:
ok Correct (2 test cases)
Test #38:
score: 0
Accepted
time: 2ms
memory: 3728kb
input:
4 250 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 250 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
? 1 250 ? 2 249 ? 3 248 ? 4 247 ? 5 246 ? 6 245 ? 7 244 ? 8 243 ? 9 242 ? 10 241 ? 11 240 ? 12 239 ? 13 238 ? 14 237 ? 15 236 ? 16 235 ? 17 234 ? 18 233 ? 19 232 ? 20 231 ? 21 230 ? 22 229 ? 23 228 ? 24 227 ? 25 226 ? 26 225 ? 27 224 ? 28 223 ? 29 222 ? 30 221 ? 31 220 ? 32 219 ? 33 218 ? 34 217 ? 3...
result:
ok Correct (4 test cases)
Test #39:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
4 250 1 1 0 250 1 1 0 250 1 1 1 250 1 1 0
output:
? 1 250 ? 1 2 ? 1 3 ! 1 ? 1 250 ? 1 2 ? 1 3 ! 1 ? 1 250 ? 1 2 ? 1 3 ! 2 ? 1 250 ? 1 2 ? 1 3 ! 1
result:
ok Correct (4 test cases)
Test #40:
score: 0
Accepted
time: 1ms
memory: 3884kb
input:
4 250 0 0 0 0 1 0 1 1 250 0 0 0 0 1 0 1 1 250 0 0 1 1 0 250 0 0 1 0 1 1
output:
? 1 250 ? 2 249 ? 3 248 ? 4 247 ? 5 246 ? 5 1 ? 246 1 ? 246 2 ! 2 ? 1 250 ? 2 249 ? 3 248 ? 4 247 ? 5 246 ? 5 1 ? 246 1 ? 246 2 ! 2 ? 1 250 ? 2 249 ? 3 248 ? 3 1 ? 3 2 ! 1 ? 1 250 ? 2 249 ? 3 248 ? 3 1 ? 248 1 ? 248 2 ! 2
result:
ok Correct (4 test cases)
Test #41:
score: 0
Accepted
time: 2ms
memory: 3632kb
input:
1 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
? 1 1000 ? 2 999 ? 3 998 ? 4 997 ? 5 996 ? 6 995 ? 7 994 ? 8 993 ? 9 992 ? 10 991 ? 11 990 ? 12 989 ? 13 988 ? 14 987 ? 15 986 ? 16 985 ? 17 984 ? 18 983 ? 19 982 ? 20 981 ? 21 980 ? 22 979 ? 23 978 ? 24 977 ? 25 976 ? 26 975 ? 27 974 ? 28 973 ? 29 972 ? 30 971 ? 31 970 ? 32 969 ? 33 968 ? 34 967 ? ...
result:
ok Correct (1 test case)
Extra Test:
score: 0
Extra Test Passed