QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#523684 | #4575. Interactive Treasure Hunt | OMoonStars | WA | 1ms | 3672kb | C++17 | 831b | 2024-08-18 16:14:54 | 2024-08-18 16:14:55 |
Judging History
answer
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define endl '\n'
using namespace std;
using ll=long long;
using db=double;
using pii=pair<int,int>;
int dig(int r,int c)
{
cout << "DIG " << r << ' ' << c << endl;
cin >> r;
return r;
}
int scan(int r,int c)
{
cout << "SCAN " << r << ' ' << c << endl;
cin >> r;
return r;
}
void solve()
{
int n,m;
cin >> n >> m;
int sum=scan(1,1)+4;
int sumx=(scan(1,m)+sum-2*m-2)/2,sumy=sum-sumx;
int disx=scan(sumx/2,1)-sumy+2,disy=scan(1,sumy/2)-sumx+2;
int x1=(sumx-disx)/2,y1=(sumy-disy)/2,x2=sumx-x1,y2=sumy-y1;
if(dig(x1,y1))
dig(x2,y2);
else
dig(x1,y2),dig(x2,y1);
}
int main()
{
ios::sync_with_stdio(false);
int t;
cin >> t;
while(t--)
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3672kb
input:
1 2 3 3 1
output:
SCAN 1 1 SCAN 1 3 SCAN 0 1
result:
wrong answer Integer 0 violates the range [1, 2] (test case 1)