QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#734528#9537. Chinese Chesslucky_cuiWA 1ms3644kbC++141.5kb2024-11-11 12:11:042024-11-11 12:11:05

Judging History

你现在查看的是最新测评结果

  • [2024-11-11 12:11:05]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3644kb
  • [2024-11-11 12:11:04]
  • 提交

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: 3644kb

input:

1
9 0

output:

3
? 8 0

result:

wrong answer solution think m=3, while jury think m=1.