QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#734536#9537. Chinese Chesslucky_cuiWA 1ms3620kbC++141.5kb2024-11-11 12:17:442024-11-11 12:17:44

Judging History

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

  • [2024-11-11 12:17:44]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3620kb
  • [2024-11-11 12:17:44]
  • 提交

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){
	int num;
	cout << '?' << " " << x << " " << y;
	cout << "\n";
	cin >> num;
	return num;
	cout.flush();
}
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;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3620kb

input:

1
9 0

output:

3
? 8 0

result:

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