QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#772850 | #9621. 连方 | CodyLee# | WA | 0ms | 3616kb | C++23 | 2.2kb | 2024-11-22 22:23:56 | 2024-11-22 22:23:59 |
Judging History
answer
#include<bits/stdc++.h>
#define x first
#define y second
#define endl '\n'
#define debug(x) cout<<#x<<" = "<<x<<endl
#define pb push_back
#define maxheap(x) priority_queue<x,vector<x>,less<x> >
#define minheap(x) priority_queue<x,vector<x>,greater<x> >
#pragma GCC optimize(2)
using namespace std;
typedef long long ll;
const int N = 2e6 + 10;
const int INF = 2147483647;
ll e[N];
typedef pair<int,int> pii;
ll qpow(ll a,ll b,ll p)
{
ll res = 1;
while(b > 0)
{
if(b & 1) res = res * a % p;
a = a * a % p;b >>= 1;
}
return res;
}
ll exgcd(ll a,ll b,ll &x,ll &y)
{
if(b == 0)
{
x = 1,y = 0;
return a;
}
ll d = exgcd(b,a % b,y,x);
y -= a / b * x;
return d;
}
void solve()
{
int n;
cin >> n;
string a,b;
cin >> a >> b;
int cnt = 0;
for(int i = 0;i < n;i ++)
{
if(a[i] == '.')
{
cnt ++;
break;
}
}
for(int i = 0;i < n;i ++)
{
if(b[i] == '.')
{
cnt ++;
break;
}
}
if(cnt == 0)
{
cout << "Yes" << endl;
for(int i = 1;i <= 7;i ++)
{
for(int j = 0;j < n;j ++)
cout << '#';
cout << endl;
}
return ;
}
int flag = 0;
for(int i = 0; i < n; i ++) {
if(a[i] == '#') {
flag ++;
break;
}
}
for(int i = 0; i < n; i ++) {
if(b[i] == '#') {
flag ++;
break;
}
}
//cout << cnt << flag;
if(cnt == 1 && flag == 2)
{
cout << "No" << endl;
return ;
}
string aa = "";
string bb = "";
for(int i = 0;i < n;i ++)
{
if(a[i] == '.') aa += '#';
else aa +='.';
}
for(int i = 0;i < n;i ++)
{
if(b[i] == '.') bb += '#';
else bb +='.';
}
cout << "Yes" << endl;
cout << a << endl;
cout << aa << endl;
cout << aa << endl;
string ans = "";
for(int i = 0;i < n;i ++)
{
if(aa[i] == '.' && bb[i] == '.') ans += '#';
else if(aa[i] == '.' && bb[i] == '#') ans += '#';
else ans += '.';
}
cout << ans << endl;
cout << bb << endl;
cout << bb << endl;
cout << b << endl;
}
int main()
{
ios :: sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while(t --)
{
solve();
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3616kb
input:
5 4 #..# .##. 5 ##.#. .#.## 6 ###### .####. 27 .######.######.####.#.##### .####...####..#.......##### 10 ########## ##########
output:
Yes #..# .##. .##. #..# #..# #..# .##. Yes ##.#. ..#.# ..#.# ##.#. #.#.. #.#.. .#.## No Yes .######.######.####.#.##### #......#......#....#.#..... #......#......#....#.#..... .######.######.####.#.##### #....###....##.#######..... #....###....##.#######..... .####...####..#.......##### Yes ########...
result:
wrong answer Testcase 2: Rectangular condition failed.