QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#664681#7156. Find the Boxnjoop#WA 1ms3812kbC++171.0kb2024-10-21 21:43:522024-10-21 21:43:53

Judging History

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

  • [2024-10-21 21:43:53]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3812kb
  • [2024-10-21 21:43:52]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

int h, w, x, y;

int main() {
    cin >> h >> w;
    string s;
    for(int i=1; i<=h; i++) {
        s.append("<");
    }
    for(int i=1; i<=w; i++) {
        s.append("^");
    }
    cout << "? " << s << endl;
    cin >> x >> y;
    if(y != 0) {
        cout << "! " << x << " " << y-1; 
        return 0;
    }
    if(x != 0) {
        cout << "! " << x-1 << " " << y;
        return 0;
    }
    for(int i=0; i<w-1; i++) {
        s = "";
        for(int j=0; j<h-1; j++) {
            s.append(i%2 ? "^" : "v");
        }
        s.append("<");
        cout << "? " << s << endl;
        cin >> x >> y;
        if(i%2 == 0 && x != h-1) {
            cout << "! " << x+1 << " " << y;
            return 0;
        }
        if(i%2 == 1 && x != 0) {
            cout << "! " << x-1 << " " << y;
            return 0;
        }
        if(y != i+1) {
            cout << "! " << x << " " << y+1;
            return 0;
        }
    }
    return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3812kb

input:

4 5
0 0
3 0

output:

? <<<<^^^^^
? vvv<
! 3 1

result:

wrong answer expected (2,3) but got (3,1)