QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#664857 | #7156. Find the Box | spycoderyt# | 0 | 1ms | 3628kb | C++14 | 842b | 2024-10-21 22:47:28 | 2024-10-21 22:47:30 |
answer
#include <bits/stdc++.h>
using namespace std;
int n,m,x,y;
int main(){
cin>>n>>m;
for(int cnt = 0;cnt<n;cnt++) {
string st;
cout << "? ";
for(int i = 0;i<cnt;i++) cout << 'v';
for(int j = 0;j<m;j++) cout << '>';
cout << endl;
cin>>x>>y;
if(x!=cnt) {
cout << "! " << cnt << " " << 0 << endl;
return 0;
}
if(y!=m-1) {
cout << "! " << x << " " << y+1 << endl;
return 0;
}
}
}
/*
For C++ programs, first compile it (e.g. with g++ -g -O2 -std=gnu++17 -static
solution.cpp -o solution.out) and then run:
python3 testing_tool.py ./solution.out <<<"4 5 2 3"
/usr/bin/g++ -g -O2 -std=gnu++17 boxbrute.cpp -o solution.out
python3 testing_tool.py ./solution.out <<<"49 59 4 0"
*/
详细
Test #1:
score: 0
Acceptable Answer
time: 1ms
memory: 3628kb
input:
4 5 0 4 1 4 2 2
output:
? >>>>> ? v>>>>> ? vv>>>>> ! 2 3
result:
points 0.820 0.82 used 3 queried; score: 82.00