This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#pragma GCC optimize ("O3,unroll-loops")
#pragma GCC target("avx2")
#define pb push_back
#define F first
#define S second
#define all(a) a.begin(),a.end()
#define pii pair <int,int>
#define PII pair<pii , pii>
#define int long long
#define sz(v) (int)v.size()
#define rep(i , a , b) for(int i=a;i <= (b);i++)
#define per(i , a , b) for(int i=a;i >= (b);i--)
#define deb(x) cout <<#x << " : " << x << "\n" ;
using namespace std ;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int maxn = 2e5 + 10 , maxm = 1e6+10 , lg = 18 , inf= 1e18 , mod = 998244353 ;
signed main(){
ios_base::sync_with_stdio(false);cin.tie(0);
int t ;
cin >> t;
while(t--){
int n , m ;
cin >> n >> m ;
if(n+(m-1)/2 >= m+(n-1)/2){
rep(i , 1, n){
rep(j ,1 , m){
if(j%2==1){
cout << "+" ;
}else{
cout << "-" ;
}
}
cout << "\n";
}
}else{
rep(i , 1 ,n){
rep(j , 1, m){
if(i%2==0){
cout << "+" ;;
}else{
cout << "-" ;
}
}
cout << "\n";
}
}
}
}
/*
*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |