#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(v) (v).begin(), (v).end()
void solve() {
int n, m;
cin >> n >> m;
vector<vector<char>> a(n, vector<char>(m));
if (n < m) {
for (int i = 0; i < n; i++) {
if (i < ((n - 1) >> 1)) {
for (int j = 0; j < m; j++)
a[i][j] = '+';
}
else {
for (int j = 0; j < m; j++)
a[i][j] = '-';
}
}
}
else {
for (int i = 0; i < m; i++) {
if (i < ((m - 1) >> 1)) {
for (int j = 0; j < n; j++)
a[j][i] = '-';
}
else {
for (int j = 0; j < n; j++)
a[j][i] = '+';
}
}
}
for (auto i : a) {
for (auto j : i)
cout << j;
cout << '\n';
}
cout << '\n';
}
int main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
int T;
cin >> T;
while (T--) solve();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Expected integer, but "---" found |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Expected integer, but "+++++++++++++++++++++++++++++++++++++++++++++" found |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Expected integer, but "---" found |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
18 ms |
1368 KB |
Expected integer, but "----------+++++++++++" found |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
17 ms |
1368 KB |
Expected integer, but "-----------+++++++++++++" found |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Expected integer, but "---" found |
2 |
Halted |
0 ms |
0 KB |
- |