QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#809913 | #9621. 连方 | Nana7# | WA | 1ms | 5844kb | C++14 | 1.1kb | 2024-12-11 18:13:18 | 2024-12-11 18:13:22 |
Judging History
answer
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<queue>
#include<vector>
#define I inline
using namespace std;
const int N = 100100;
char up[N],dn[N];
int ans[8][N];
int n;
I void solve() {
cin>>n;
scanf("%s",up+1);
scanf("%s",dn+1);
for(int i=1;i<=n;++i)
for(int j=1;j<=7;++j) ans[j][i]=0;
for(int i=1;i<=n;++i) {
ans[1][i]=(up[i]=='#');
ans[7][i]=(dn[i]=='#');
}
for(int i=1;i<=n;++i) {
ans[2][i]=1-ans[1][i];
ans[6][i]=1-ans[7][i];
}
bool f1=1,f2=1;
for(int i=1;i<=n;++i) {
if(!ans[1][i]) f1=0;
if(!ans[7][i]) f2=0;
}
if(f1&&f2) {
cout<<"Yes"<<endl;
for(int i=1;i<=7;++i) {
for(int j=1;j<=n;++j) putchar('#');
putchar('\n');
}
return ;
}
if(f1||f2) {
cout<<"No"<<endl;
return ;
}
cout<<"Yes"<<endl;
for(int i=1;i<=n;++i) {
if(ans[2][i]==ans[6][i]&&!ans[2][i]) {
for(int j=3;j<=5;++j) {
ans[j][i]=1;
}
}
}
for(int i=1;i<=7;++i) {
for(int j=1;j<=n;++j) {
if(ans[i][j]) putchar('#');
else putchar('.');
} putchar('\n');
}
}
int main()
{
int T; cin>>T;
while(T--) {
solve();
}
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 5844kb
input:
5 4 #..# .##. 5 ##.#. .#.## 6 ###### .####. 27 .######.######.####.#.##### .####...####..#.......##### 10 ########## ##########
output:
Yes #..# .##. .... .... .... #..# .##. Yes ##.#. ..#.# .#.#. .#.#. .#.#. #.#.. .#.## No Yes .######.######.####.#.##### #......#......#....#.#..... .####...####..........##### .####...####..........##### .####...####..........##### #....###....##.#######..... .####...####..#.......##### Yes ########...
result:
wrong answer Testcase 1: Connected condition failed.