QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#496931 | #4575. Interactive Treasure Hunt | cyanac | WA | 1ms | 3636kb | C++14 | 1.2kb | 2024-07-28 17:01:51 | 2024-07-28 17:01:53 |
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;
int midy=sumy/2;
query(1,midy);
int t3;
cin>>t3;
t3+=2;
int y1=(t1-t3)/2;
int y2=sumy-y1;
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);
cin>>flag;
}
else
{
dig(x1,y2);
cin>>flag;
dig(x2,y1);
cin>>flag;
}
}
signed main()
{
int T;
cin>>T;
while(T--) solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3636kb
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)