Submission #1294853

#TimeUsernameProblemLanguageResultExecution timeMemory
1294853kawhietRed-blue table (IZhO19_stones)C++20
0 / 100
9 ms4412 KiB
#include <bits/stdc++.h> using namespace std; void solve() { int n, m; cin >> n >> m; if (n / 2 + m < m / 2 + n) { cout << m / 2 + n << '\n'; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cout << (i & 1 ? '+' : '-'); } cout << '\n'; } } else { cout << n / 2 + m << '\n'; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cout << (j & 1 ? '+' : '-'); } cout << '\n'; } } } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while (t--) { solve(); } return 0; }
#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...