Submission #331597

# Submission time Handle Problem Language Result Execution time Memory
331597 2020-11-29T05:01:08 Z bayarkhuu Red-blue table (IZhO19_stones) C++14
0 / 100
122 ms 2364 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 1 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 1 ms 364 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 122 ms 2284 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 108 ms 2364 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong answer
2 Halted 0 ms 0 KB -