QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#664377#7156. Find the BoxNamkhing#TL 0ms0kbC++14665b2024-10-21 20:22:272024-10-21 20:22:31

Judging History

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

  • [2024-10-21 20:22:31]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:0kb
  • [2024-10-21 20:22:27]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;


int main() {
    int n, m;
    cin >> n >> m;
    cout << "?";
    for (int i = 1; i <= n; i++) {
        cout << "v";
    }
    int x, y;
    cin >> x >> y;
    if (x != n - 1) {
        cout << "! " << x + 1 << " " << y;
        return 0;
    }
    for (int i = 1; i <= n; i++) {
        cout << "?";
        for (int j = 2; j <= i; j++) {
            cout << "v";
        }
        for (int j = 1; j <= m; j++) {
            cout << ">";
        }
        cin >> x >> y;
        if (y != m - 1) {
            cout << "! " << x << " " << y + 1;
            return 0;
        }
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Time Limit Exceeded

input:

4 5

output:

?vvvv

result: