| 记录编号 |
611374 |
评测结果 |
AAAAAAAAA |
| 题目名称 |
[THUPC 2025 Final] 三元链 |
最终得分 |
100 |
重新评测 |
|
| 用户昵称 |
李佳峰 |
是否通过 |
通过 |
| 代码语言 |
C++ |
运行时间 |
0.227 s |
| 提交时间 |
2026-01-29 18:51:46 |
内存使用 |
3.68 MiB |
显示代码纯文本
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
freopen("thupc_2025_trilink.in", "r", stdin);
freopen("thupc_2025_trilink.out", "w", stdout);
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin>>t;
while(t--){
int n,k;
cin>>n>>k;
if(k>(2*n)/3 or k<(n+1)/2)cout<<"No"<<endl;
else{
cout<<"Yes"<<endl;
int y=2*k-n;
int x=k-2*y;
string s0[2],s1[3];
s0[0]="##.";
s0[1]="..#";
s1[0]="##.";
s1[1]="#.#";
s1[2]=".##";
for(int i=1;i<=x;i++){
for(int k=0;k<=1;k++){
for(int j=0;j<n;j++){
cout<<s0[k][j%3];
}
cout<<endl;
}
}
for(int i=1;i<=y;i++){
for(int k=0;k<=2;k++){
for(int j=0;j<n;j++){
cout<<s1[k][j%3];
}
cout<<endl;
}
}
}
}
}