QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#653205#4575. Interactive Treasure HuntIllusionaryDominance#WA 0ms3768kbC++201.3kb2024-10-18 19:42:372024-10-18 19:42:39

Judging History

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

  • [2024-10-18 19:42:39]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3768kb
  • [2024-10-18 19:42:37]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

int Scan(int r, int c) {
    printf("SCAN %d %d\n", r, c);
    fflush(stdout);
    int x;
    scanf("%d", &x);
    return x;
}

int Dig(int r, int c) {
    printf("Dig %d %d\n", r, c);
    fflush(stdout);
    int x;
    scanf("%d", &x);
    return x;
}

int main() {
    int T;
    scanf("%d", &T);
    while (T --) {
        int n, m;
        scanf("%d%d", &n, &m);
        int a1 = Scan(1, m);
        int a2 = Scan(1, 1);
        
        assert(~ a1 + a2 & 1);
        int x12 = (a1 + a2 >> 1) + 3 - m;
        int y12 = (a2 - a1 >> 1) + 1 + m;
        assert(x12 > 0 && y12 > 0);
        
        int ymid = y12 + 1 >> 1;
        int a3 = Scan(1, ymid);
        assert(a3 + 2 - x12 >= 0);
        int y22 = a3 + 2 - x12 + y12;
        assert(~ y22 & 1);
        int y2 = y22 / 2, y1 = y12 - y2;
        assert(y1 <= y2);
        
        int xmid = x12 + 1 >> 1;
        int a4 = Scan(xmid, 1);
        assert(a4 + 2 - y12 >= 0);
        int x22 = a4 + 2 - y12 + x12;
        assert(~ x22 & 1);
        int x2 = x22 / 2, x1 = x12 - x2;
        assert(x1 <= x2);
        
        if (Dig(x1, y1)) {
            Dig(x2, y2);
        }else {
            Dig(x1, y2);
            Dig(x2, y1);
        }
    }
    
    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3768kb

input:

1
2 3
1
3
1
3

output:

SCAN 1 3
SCAN 1 1
SCAN 1 3
SCAN 1 1
Dig 1 2

result:

wrong answer invalid command :