Submission #444731

# Submission time Handle Problem Language Result Execution time Memory
444731 2021-07-15T02:23:07 Z nickyrio Red-blue table (IZhO19_stones) C++17
0 / 100
46 ms 1252 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() {
    int test;
    cin >> test;
    while (test--) Solve();
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB in the table A+B is not equal to 4
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 204 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 1 ms 204 KB in the table A+B is not equal to 4
# Verdict Execution time Memory Grader output
1 Incorrect 46 ms 1252 KB Wrong answer in test 97 21: 107 < 116
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 45 ms 1220 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 1 ms 204 KB in the table A+B is not equal to 4