标签:多校8 enc play following tput void define 位置 while
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 0 Accepted Submission(s): 0
Special Judge
#include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; const int MAX = 205; typedef long long LL; int main(void) { int t,n,m,i,j; scanf("%d",&t); while(t--){ scanf("%d%d",&n,&m); if((n&1)&&(m&1)){ for(i=1;i<=n;i++){ for(j=1;j<=m;j++){ printf("("); } printf("\n"); } } else if(n&1){ for(i=1;i<=n;i++){ for(j=1;j<=m;j++){ if(j&1) printf("("); else printf(")"); } printf("\n"); } } else if(m&1){ for(i=1;i<=n;i++){ for(j=1;j<=m;j++){ if(i&1) printf("("); else printf(")"); } printf("\n"); } } else{ if(n>=m){ for(i=1;i<=n;i++){ for(j=1;j<=m;j++){ if(i==1&&(m/2-1)>2){ printf("("); continue; } if(i==n&&(m/2-1)>2){ printf(")"); continue; } if(j==1){ printf("("); continue; } if(j==m){ printf(")"); continue; } if((i+j)&1){ printf(")"); } else{ printf("("); } } printf("\n"); } } else{ for(i=1;i<=n;i++){ for(j=1;j<=m;j++){ if(j==1&&(n/2-1)>2){ printf("("); continue; } if(j==m&&(n/2-1)>2){ printf(")"); continue; } if(i==1){ printf("("); continue; } if(i==n){ printf(")"); continue; } if((i+j)&1){ printf(")"); } else{ printf("("); } } printf("\n"); } } } } return 0; }
标签:多校8 enc play following tput void define 位置 while
原文地址:https://www.cnblogs.com/yzm10/p/9482992.html