Submission #331596

# Submission time Handle Problem Language Result Execution time Memory
331596 2020-11-29T04:30:20 Z bayarkhuu Red-blue table (IZhO19_stones) C++14
0 / 100
121 ms 2416 KB
#include <algorithm>
#include <iostream>

using namespace std;

int main() {
    int t, n, m;

    cin >> t;

    while (t--) {
        cin >> n >> m;

        if (n >= m) {
            cout << n + (m - 1) / 2 << endl;
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    if ((m - 1) / 2 < j) {
                        cout << "-";
                    } else {
                        cout << "+";
                    }
                    if (j != m - 1) {
                        cout << " ";
                    }
                }
                cout << endl;
            }
        } else {
            cout << m + (n - 1) / 2 << endl;
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    if ((n - 1) / 2 < i) {
                        cout << "+";
                    } else {
                        cout << "-";
                    }
                    if (j != m - 1) {
                        cout << " ";
                    }
                }
                cout << endl;
            }
        }
    }

    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 364 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 364 KB Wrong answer
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 364 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 121 ms 2416 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 102 ms 2284 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 364 KB Wrong answer
2 Halted 0 ms 0 KB -