QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#496921#1458. Binary Search AlgorithmcyanacWA 0ms3652kbC++141.0kb2024-07-28 16:58:322024-07-28 16:58:33

Judging History

This is the latest submission verdict.

  • [2024-07-28 16:58:33]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3652kb
  • [2024-07-28 16:58:32]
  • Submitted

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: 0ms
memory: 3652kb

input:

3
add 1

output:

SCAN 1 1
SCAN 94141353013600 1
SCAN 1 11646925022445
SCAN 58717601535348 1
DIG -7 -135
DIG -7 23293850045026
DIG 117435203070704 -135
SCAN 1 1
SCAN 94141353013600 1
SCAN 1 11646925022447
SCAN 58717601535349 1
DIG -6 -134
DIG -6 23293850045028
DIG 117435203070704 -134
SCAN 1 1
SCAN 94141353013600 1
S...

result:

wrong answer < add 1