Submission #1353636

#TimeUsernameProblemLanguageResultExecution timeMemory
1353636hsuan._.0528Find the Box (EGOI23_findthebox)C++20
100 / 100
0 ms344 KiB
// pC
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define pii pair<LL, LL>
#define S second
#define F first
const int maxn = 100+10;

int h, w;

pii qq(string s){
    cout << "? " << s << endl;
    int a, b;  cin >> a >> b;
    return  make_pair(a, b);
}

void out(int a, int b){
    cout << "! " << a << " " << b << endl;
}

signed main(){

    cin >> h >> w;
    string s = "";
    for(int i=1; i<w; i++)  s += '>';
    for(int i=1; i<h; i++)  s += 'v';
    auto[x, y] = qq(s);
    if(x != h - 1){
        out(x + 1, w - 1);
        return 0;
    }else if(y != w - 1){
        out(0, y + 1);
        return 0;
    }

    s = "";
    for(int i=0; i<=h; i++){
        for(int j=1; j<w; j++)  s += '>';
        for(int j=0; j<w; j++)  s += "v<^";
        s += '<';
        s += 'v';
    }
    auto[xx, yy] = qq(s);
    out(xx + 1, yy);

}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...