QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#781626#8020. Mine Sweeper IIUnstalian#WA 0ms3652kbC++20748b2024-11-25 16:42:272024-11-25 16:42:28

Judging History

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

  • [2024-11-25 16:42:28]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3652kb
  • [2024-11-25 16:42:27]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define maxn 1005

int n, m;
string a[maxn], b[maxn];
void solve(){
	cin >> n>> m;
	for (int i = 1;i <= n;i ++) cin >> a[i];
	for (int i = 1;i <= n;i ++) cin >> b[i];
	
	int cnt = n * m / 2;
	for (int i = 1;i <= n;i ++) {
		for (int j = 0;j < m;j ++) {
			if(a[i][j] != b[i][j]) cnt --;
		}
	}
	cout << cnt<<endl;
	if(cnt < 0){
		for (int i = 1;i <= n;i ++){
			for (int j = 0;j < m;j ++){
				a[i][j] = (a[i][j] == '.') ? 'X' : '.';
			}
		}
	}
	for (int i = 1;i <= n;i ++) {
		cout << a[i]<<endl;;
	}
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	int T = 1;
	// cin >> T;
	while (T --)
		solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3652kb

input:

2 4
X..X
X.X.
X.X.
.X..

output:

-1
.XX.
.X.X

result:

wrong answer Line "-1" doesn't correspond to pattern "[.X]{4}"