QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#470579#8020. Mine Sweeper IIlonlynessWA 0ms16076kbC++231.1kb2024-07-10 15:15:462024-07-10 15:15:47

Judging History

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

  • [2024-07-10 15:15:47]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:16076kb
  • [2024-07-10 15:15:46]
  • 提交

answer

#include<iostream>
#include<algorithm>
#include<cstring>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<cmath>
using namespace std;
#define int long long 
#define endl "\n"
const int N = 2e5+10,mod = 998244353;
int n,m,k;
typedef pair<int,int> PII;
string a[N],b[N];
void solve()  
{
    cin>>n>>m;
    for(int i = 0;i< n;i ++)cin>>a[i];
    for(int i = 0;i < n;i ++)cin>>b[i];
    int ans =0;
    for(int i= 0;i< n;i ++)
    {
        for(int j = 0;j < m;j ++)ans+=(a[i][j]!=b[i][j]);
    }
    if(ans*2<=n*m)
    {
        for(int i= 0;i < n;i ++){
            for(int j= 0;j < m;j ++)
            cout<<a[i][j]<<' ';
            cout<<endl;
                
        }
    }
    else {
        for(int i = 0;i < n;i ++)
        {
            for(int j= 0;j < m;j ++)
            {
                if(a[i][j]=='.')cout<<'X'<<' ';
                else cout<<'.'<<' ';
            }
            cout<<endl;
        }
    }
    
}
signed  main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
  int t=1;
//   cin>>t;
  while(t--)
  {
      solve();
  }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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

output:

. X X . 
. X . X 

result:

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