Submission #444732

# Submission time Handle Problem Language Result Execution time Memory
444732 2021-07-15T02:25:18 Z nickyrio Red-blue table (IZhO19_stones) C++17
0 / 100
33 ms 1228 KB
#include <bits/stdc++.h>

using namespace std;

void Solve() {
    int n, m, ans = 0;
    cin >> n >> m;
    pair<int, int> best = {0, 0};
    for (int i = 0; i <= n; ++ i) {
        for (int j = 0; j <= m; ++j) {
            int curr = j * (i * 2 > n) + i * (j * 2 < m);
            if (curr > ans) {
                ans = curr;
                best = {i, j};
            }
        }
    }
    cout << ans << '\n';
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            if (i < best.first && j < best.second) cout << '-';
            else cout << '+';
        }
        cout << '\n';
    }
}
int main() {
  ios::sync_with_stdio(false); cin.tie(NULL);
    int test;
    cin >> test;
    while (test--) Solve();
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 0 ms 204 KB in the table A+B is not equal to 4
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB in the table A+B is not equal to 45
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 0 ms 204 KB in the table A+B is not equal to 4
# Verdict Execution time Memory Grader output
1 Incorrect 33 ms 1216 KB Wrong answer in test 97 21: 107 < 116
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 32 ms 1228 KB Wrong answer in test 24 24: 35 < 44
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 0 ms 204 KB in the table A+B is not equal to 4