Submission #919550

#TimeUsernameProblemLanguageResultExecution timeMemory
919550manizareRed-blue table (IZhO19_stones)C++14
0 / 100
19 ms1368 KiB
#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){ cout << n+(m-1)/2 << "\n"; rep(i , 1, n){ rep(j ,1 , m){ if(j%2==1){ cout << "+" ; }else{ cout << "-" ; } } cout << "\n"; } }else{ cout << m+(n-1)/2 << "\n"; rep(i , 1 ,n){ rep(j , 1, m){ if(i%2==0){ cout << "+" ;; }else{ cout << "-" ; } } cout << "\n"; } } } } /* */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...