QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#734526 | #9537. Chinese Chess | lucky_cui | WA | 1ms | 3568kb | C++14 | 1.5kb | 2024-11-11 12:09:38 | 2024-11-11 12:09:39 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
pii a[100];
char ans;
void cheak1(int x,int y,int z){
if(x == 1 && y == 3 && z == 2) ans = 'J';
if(x == 1 && y == 3 && z == -1) ans = 'B';
if(x == 1 && y == 2) ans = 'C';
if(x == 1 && y == -1) ans = 'B';
if(x == -1 && y == -1 && z == 1) ans = 'S';
if(x == -1 && y == -1 && z == -1) ans = 'X';
if(x == 3) ans = 'M';
}
void cheak2(int x,int y,int z){
if(x == 1 && y == 2) ans = 'J';
if(x == 1 && y == 1) ans = 'C';
if(x == -1 && y == 2) ans = 'S';
if(x == -1 && y == -1 && z == 1) ans = 'X';
if(x == -1 && y == -1 && z == -1) ans = 'B';
if(x == 3) ans = 'M';
}
int query(int x,int y){
cout << '?' << " " << x << " " << y;
cout << "\n";
cout.flush();
int num;
cin >> num;
return num;
}
void solve(pii s){
int r = s.first;
int c = s.second;
int ans[3];
if(r <= 6){
ans[0] = query(r+1,c);
if(r <= 7) ans[1] = query(r+2,c+1);
else ans[1] = query(r+2,c-1);
if(r >= 1) ans[2] = query(r-1,c+1);
else ans[2] = query(r+1,c+1);
cheak1(ans[0] , ans[1] , ans[2]);
}else{
ans[0] = query(r-1 , c);
ans[1] = query(r-2 , c);
if(c<= 6) ans[2] = query(r-2 , c+2);
else ans[2] = query(r-2 , c-2);
cheak2(ans[0] , ans[1] , ans[2]);
}
}
int main()
{
int n;
cin >> n;
for(int i = 1;i <= n;i ++ ){
cin >> a[i].first >> a[i].second;
}
cout << 3*n << "\n";
cout.flush();
for(int i = 1;i <= n;i ++ ){
solve(a[i]);
}
cout << ans << "\n";
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3568kb
input:
1 9 0
output:
3 ? 8 0
result:
wrong answer solution think m=3, while jury think m=1.