Submission #1353584

#TimeUsernameProblemLanguageResultExecution timeMemory
1353584yyc000123Find the Box (EGOI23_findthebox)C++20
0 / 100
0 ms412 KiB
#include<bits/stdc++.h>
using namespace std ;
const int N = 55 ;
int n , m , x , y ;

int main(){
    cin >> n >> m ;
    cout << "? " ;
    for(int i=1 ; i<m ; i++) cout << '>' ;
    cout << endl ;
    cin >> x >> y ;
    if(y!=m-1){
        cout << "! 0 " << y+1 << endl ;
        return 0 ;
    }
    for(int i=0 ; i<min(n,m)-1 ; i++){
        cout << "? " ;
        for(int j=0 ; j<i ; j++) cout << '>' ;
        for(int j=n-i-1 ; j>0 ; j--) cout << 'v' ;
        for(int j=m-i-1 ; j>0 ; j--) cout << '>' ;
        cout << endl ;
        cin >> x >> y ;
        if(x==n-1-i && y==m-1) continue ;
        // n-1-i , m-1-i
        if(x==n-1-i) cout << "! " << x << ' ' << y+1 << endl ;
        else cout << "! " << x+1 << ' ' << i << endl ;
        return 0 ;
    }
    cout << "! 0 " << m-1 << endl ;
    return 0 ;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...