QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#545577 | #8020. Mine Sweeper II | wzxtsl# | RE | 0ms | 0kb | C++14 | 1.9kb | 2024-09-03 15:11:12 | 2024-09-03 15:11:12 |
answer
#include<bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
typedef long long ll;
#define For(i,j,k) for (int i=(j);i<=(k);i++)
#define rof(i,j,k) for (int i=(j);i>=(k);i--)
#define ull unsigned long long
#define lowbit(x) ((x)&(-(x)))
#define PII pair<int,int>
#define int long long
#define endl "\n"
#define ls rt<<1
#define rs rt<<1|1
const int mod = 998244353;
const int N=1e3+7;
bool a[9][N][N],b[N][N];
int cnt[9];
int n,m;
char op;
void solve(){
cin>>n>>m;
For(i,1,n)
{
For(j,1,m)
{
cin>>op;
if(op=='X') a[1][i][j]=1,a[5][i][j]=0;
else a[1][i][j]=0,a[5][i][j]=1;
}
}
For(i,1,n)
{
For(j,1,m)
{
cin>>op;
if(op=='X') b[i][j]=1;
else b[i][j]=0;
}
}
For(i,1,n)
{
For(j,1,m)
{
a[2][i][j]=a[1][i][m-j+1];
a[6][i][j]=a[5][i][m-j+1];
}
}
For(j,1,m)
{
For(i,1,n)
{
a[3][i][j]=a[1][n-i+1][j];
a[7][i][j]=a[5][n-i+1][j];
a[4][i][j]=a[2][n-i+1][j];
a[8][i][j]=a[6][n-i+1][j];
}
}
memset(cnt,0,sizeof(cnt));
For(i,1,n)
{
For(j,1,m)
{
For(k,1,8)
{
if(a[k][i][j]!=b[i][j]) cnt[k]++;
}
}
}//cout<<cnt[1]<<"!";
For(k,1,8)
{
if(cnt[k]<=m*n/2)
{
For(i,1,n)
{
For(j,1,m)
{
if(a[k][i][j]==1) cout<<"X";
else cout<<".";
}
cout<<endl;
}
break;
}
}
}
signed main(){
int t=1;
//cin>>t;
while(t--){
solve();
}
system("pause");
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Dangerous Syscalls
input:
2 4 X..X X.X. X.X. .X..