QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#664681 | #7156. Find the Box | njoop# | WA | 1ms | 3812kb | C++17 | 1.0kb | 2024-10-21 21:43:52 | 2024-10-21 21:43:53 |
Judging History
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=0; i<w-1; i++) {
s = "";
for(int j=0; j<h-1; j++) {
s.append(i%2 ? "^" : "v");
}
s.append("<");
cout << "? " << s << endl;
cin >> x >> y;
if(i%2 == 0 && x != h-1) {
cout << "! " << x+1 << " " << y;
return 0;
}
if(i%2 == 1 && x != 0) {
cout << "! " << x-1 << " " << y;
return 0;
}
if(y != i+1) {
cout << "! " << x << " " << y+1;
return 0;
}
}
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3812kb
input:
4 5 0 0 3 0
output:
? <<<<^^^^^ ? vvv< ! 3 1
result:
wrong answer expected (2,3) but got (3,1)