#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void test_case () {
int N , M;
cin >> N >> M;
vector<vector<int>> val(N + 1 , vector<int> (M + 1 , 1));
for (int i = 1;i <= (N + 2) / 2;i ++) {
for (int j = (M + 2) / 2 + 1;j <= M;j ++) {
val[i][j] = 0;
}
}
for (int i = 1;i < (M + 1) / 2;i ++) {
for (int j = (N + 1) / 2;j <= N;j ++) {
val[j][i] = 0;
}
}
char d[2] = {'-' , '+'};
cout << N - (N % 2 == 0 ? 2 : 1) + M - (M % 2 == 0 ? 2 : 1) << "\n";
for (int i = 1;i <= N;i ++) {
for (int j = 1;j <= M;j ++) {
cout << d[val[i][j]];
}
cout << "\n";
}
}
/*
11111000
11111000
00011000
00011000
00011111
00011111
11111000
00011000
00011111
*/
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int T = 1;
/// cin >> T;
while (T --) {
test_case ();
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
348 KB |
Wrong answer |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Wrong answer |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
348 KB |
Wrong answer |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
604 KB |
Wrong answer |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
in the table A+B is not equal to 164 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
348 KB |
Wrong answer |
2 |
Halted |
0 ms |
0 KB |
- |