QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#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;
}
Details
Tip: Click on the bar to expand more detailed information
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)