Submission #466630

# Submission time Handle Problem Language Result Execution time Memory
466630 2021-08-19T18:48:06 Z TeaTime Red-blue table (IZhO19_stones) C++17
0 / 100
33 ms 1260 KB
//#pragma GCC optimize("O3")
//#pragma GCC target("avx2")
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <unordered_map>
#include <cmath>

using namespace std;

#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);

typedef long long ll;
typedef long double ld;

const ll SZ = 1e6 + 100, INF = 1e9, AM = 2, K = 26;

const vector<ll> P = { 1774, 177 };
const vector<ll> MOD = { ll(1e9 + 7), ll(1e9 + 9) };
ll n, m;

signed main() {
    fastInp;

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

        if (m <= n) {
            cout << n + (m - 1) / 2 << "\n";
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    if (j * 2 < m) {
                        cout << "-";
                    } else {
                        cout << "+";
                    }
                }
                cout << "\n";
            }
        } else {
            cout << m + (n - 1) / 2 << "\n";
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    if (i == n - 1 && (n % 2) == 0) {
                        cout << "-";
                        continue;
                    }
                    if (i % 2 == 0) {
                        cout << "-";
                    } else {
                        cout << "+";
                    }
                }
                cout << "\n";
            }
        }
    }

    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB in the table A+B is not equal to 4
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB in the table A+B is not equal to 2
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB in the table A+B is not equal to 4
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 31 ms 1260 KB in the table A+B is not equal to 107
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 33 ms 1252 KB in the table A+B is not equal to 35
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB in the table A+B is not equal to 4
2 Halted 0 ms 0 KB -