Submission #384195

#TimeUsernameProblemLanguageResultExecution timeMemory
384195ritul_kr_singhRed-blue table (IZhO19_stones)C++17
11 / 100
34 ms1388 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define sp << ' ' << #define nl << '\n' signed main(){ cin.tie(0)->sync_with_stdio(0); int T; cin >> T; while(T--){ int n, m; cin >> n >> m; if(n==1){ cout << m nl; while(m--) cout << '-'; cout nl; }else if(m==1){ cout << n nl; while(n--) cout << '+' nl; }else{ cout << n + m - 2 nl; for(int i=0; i<n; ++i){ for(int j=0; j<m; ++j){ if(i and j) cout << ((i+j) % 2 ? '+' : '-'); else cout << (i ? '+' : '-'); } cout nl; } } } }
#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...