QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#496917 | #4575. Interactive Treasure Hunt | cyanac | WA | 1ms | 3628kb | C++14 | 1.0kb | 2024-07-28 16:57:51 | 2024-07-28 16:57:52 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
void query(int x,int y)
{
cout<<"SCAN"<<' '<<x<<' '<<y<<endl;
}
void dig(int x,int y)
{
cout<<"DIG"<<' '<<x<<' '<<y<<endl;
}
void solve()
{
int n,m;
cin>>n>>m;
query(1,1);
int t1;
cin>>t1;
t1+=4;
query(m,1);
int t2;
cin>>t2;
t2+=2;
int sumy=(t1+t2-2*m)/2;
// cout<<sumy<<endl;
int midy=sumy/2;
query(1,midy);
int t3;
cin>>t3;
t3+=2;
int y1=(t1-t3)/2;
// y1++;
int y2=sumy-y1;
// cout<<y1<<"aa"<<y2<<endl;
int sumx=t1-y1-y2;
int midx=sumx/2;
query(midx,1);
int t4;
cin>>t4;
t4+=2;
int x2=(sumx+t4-y1-y2)/2;
int x1=sumx-x2;
dig(x1,y1);
int flag;
cin>>flag;
if(flag)
{
dig(x2,y2);
}
else
{
dig(x1,y2);
cin>>flag;
dig(x2,y1);
cin>>flag;
}
}
signed main()
{
int T;
cin>>T;
while(T--) solve();
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3628kb
input:
1 2 3 3
output:
SCAN 1 1 SCAN 3 1
result:
wrong answer Integer 3 violates the range [1, 2] (test case 1)