Submission #147723

# Submission time Handle Problem Language Result Execution time Memory
147723 2019-08-30T13:37:16 Z theboatman Red-blue table (IZhO19_stones) C++17
0 / 100
28 ms 1340 KB
#include <bits/stdc++.h>

#define y1 theboatman
#define make_struct(args...) {args}

using namespace std;

typedef long long ll;

const long long INF = 1e18 + 10;
const int inf = 1e9 + 10;
const int N = 1e6 + 10;

void solve5(int n, int m) {
    cout << (n - 1) / 2 + m << "\n";

    for(int i = 0; i < (n - 1) / 2; i++) {
        for(int j = 0; j < m; j++) {
            cout << "+";
        }
        cout << "\n";
    }

    for(int i = (n - 1) / 2; i < n; i++) {
        for(int j = 0; j < m; j++) {
            cout << "-";
        }
        cout << "\n";
    }
}

void solve() {
    int n, m;
    cin >> n >> m;

    if (n == m) {
        solve5(n, m);
    }
    else {
        cout << "-1\n";
    }
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);

    int test;
    cin >> test;

    while(test--) {
        solve();
    }

    return 0;
}

/*
*/
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Wrong answer
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 376 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 28 ms 1340 KB Wrong answer in test 24 24: 35 < 44
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Wrong answer
2 Halted 0 ms 0 KB -