QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#664730#7156. Find the Boxblackslex#0 1ms3848kbC++141.1kb2024-10-21 22:02:172024-10-21 22:02:18

Judging History

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

  • [2024-10-21 22:02:18]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:3848kb
  • [2024-10-21 22:02:17]
  • 提交

answer

#include<bits/stdc++.h>

using namespace std;
using pii = pair<int, int>;

int n, m, px, py;
pii pos;

int main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    cin >> n >> m;
    string s = "";
    auto ask = [&] () {
        int r, c;
        cout << "? " << s << endl;
        cin >> r >> c;
        pos = pii(r, c);
        return;
    };
    for (int j = 0; j < m; j++) {
        s = string(j, '>') + string(n - 1, 'v');
        ask();
        if (pos != pii(n - 1, j)) {
            if (pos.second != j) {
                cout << "! " << 0 << ' ' << pos.second + 1 << endl;
            } else {
                cout << "! " << pos.first + 1 << ' ' << pos.second << endl; 
            }
            return 0;
        }
    }
    for (int i = 0; i < n; i++) {
        s = string(i, 'v') + string(m - 1, '>');
        ask();
        if (pos != pii(i, m - 1)) {
            if (pos.first != i) {
                cout << "! " << pos.first + 1 << ' ' << 0 << endl;
            } else {
                cout << "! " << pos.first << ' ' << pos.second + 1 << endl;
            }
            return 0;
        }
    }
}

詳細信息

Test #1:

score: 0
Acceptable Answer
time: 1ms
memory: 3848kb

input:

4 5
3 0
3 1
3 2
1 3

output:

? vvv
? >vvv
? >>vvv
? >>>vvv
! 2 3

result:

points 0.710 0.71 used 4 queried; score: 71.00