//#pragma GCC optimize("O3")
//#pragma GCC target("avx2")
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <unordered_map>
#include <cmath>
using namespace std;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
typedef long long ll;
typedef long double ld;
const ll SZ = 1e6 + 100, INF = 1e9, AM = 2, K = 26;
const vector<ll> P = { 1774, 177 };
const vector<ll> MOD = { ll(1e9 + 7), ll(1e9 + 9) };
ll n, m;
signed main() {
fastInp;
ll t;
cin >> t;
while (t--) {
cin >> n >> m;
if (m <= n) {
cout << n + (m - 1) / 2 << "\n";
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (j == m - 1 && (m % 2) == 0) {
cout << "+";
continue;
}
if (j % 2 == 0) {
cout << "+";
} else {
cout << "-";
}
}
cout << "\n";
}
} else {
cout << m + (n - 1) / 2 << "\n";
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (i == n - 1 && (n % 2) == 0) {
cout << "+";
continue;
}
if (i % 2 != 0) {
cout << "-";
} else {
cout << "+";
}
}
cout << "\n";
}
}
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
in the table A+B is not equal to 3 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
in the table A+B is not equal to 46 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
in the table A+B is not equal to 3 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
30 ms |
1300 KB |
Wrong answer in test 97 21: 107 < 116 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
30 ms |
1228 KB |
Wrong answer in test 24 24: 35 < 44 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
in the table A+B is not equal to 3 |
2 |
Halted |
0 ms |
0 KB |
- |