QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#664617#7156. Find the Boxnjoop#WA 0ms3568kbC++17986b2024-10-21 21:27:072024-10-21 21:27:07

Judging History

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

  • [2024-10-21 21:27:07]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3568kb
  • [2024-10-21 21:27:07]
  • 提交

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=1; i<=w; i+= 2) {
        for(int j=1; j<=h; j++) {
            s.append("v");
        }
        s.append(">");
        for(int j=1; j<=h; j++) {
            s.append("^");
        }
        s.append(">");
    }
    cout << "? " << s << endl;
    cin >> x >> y;
    if(x == 0 || x == h-1) {
        cout << "! " << x << " " << y+1 << "\n";
    }
    if(y%2 == 0) {
        cout << "! " << x+1 << " " << y; 
    } else {
        cout << "! " << x-1 << " " << y;
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

4 5
0 0
0 4

output:

? <<<<^^^^^
? <<<<^^^^^vvvv>^^^^>vvvv>^^^^>vvvv>^^^^>
! 0 5
! 1 4

result:

wrong answer expected (2,3) but got (0,5)