QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#496917#4575. Interactive Treasure HuntcyanacWA 1ms3628kbC++141.0kb2024-07-28 16:57:512024-07-28 16:57:52

Judging History

你现在查看的是最新测评结果

  • [2024-07-28 16:57:52]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3628kb
  • [2024-07-28 16:57:51]
  • 提交

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)