QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#664629 | #7156. Find the Box | njoop# | WA | 0ms | 3572kb | C++17 | 999b | 2024-10-21 21:29:30 | 2024-10-21 21:29:31 |
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;
}
s = "";
for(int i=1; i<=w; i+= 2) {
for(int j=1; j<=h; j++) {
s.append("v");
}
s.append(">");
for(int j=1; j<=h; j++) {
s.append("^");
}
s.append(">");
}
cout << "? " << s << endl;
cin >> x >> y;
if(x == 0 || x == h-1) {
cout << "! " << x << " " << y+1 << "\n";
}
if(y%2 == 0) {
cout << "! " << x+1 << " " << y;
} else {
cout << "! " << x-1 << " " << y;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3572kb
input:
4 5 0 0 0 4
output:
? <<<<^^^^^ ? vvvv>^^^^>vvvv>^^^^>vvvv>^^^^> ! 0 5 ! 1 4
result:
wrong answer expected (2,3) but got (0,5)