QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#781626 | #8020. Mine Sweeper II | Unstalian# | WA | 0ms | 3652kb | C++20 | 748b | 2024-11-25 16:42:27 | 2024-11-25 16:42:28 |
Judging History
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}"