#include <bits/stdc++.h>
using namespace std;
void solution () {
int n, m;
cin >> n >> m;
char arr[n][m];
cout << n + n/2 << "\n";
if (n < m) {
swap(n, m);
}
for (int i = 0; i < m; i++) {
for (int j = 0, a = n/2+1; j < n; j++) {
if (a != 0) {
arr[i][j] = '+';
a--;
}else {
arr[i][j] = '-';
}
cout << arr[i][j];
}
cout << "\n";
}
}
int main () {
ios::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--) solution();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
364 KB |
in the table A+B is not equal to 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
in the table A+B is not equal to 4 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
364 KB |
in the table A+B is not equal to 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
35 ms |
1388 KB |
Wrong answer |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
34 ms |
1516 KB |
in the table A+B is not equal to 36 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
364 KB |
in the table A+B is not equal to 1 |
2 |
Halted |
0 ms |
0 KB |
- |