제출 #884718

#제출 시각아이디문제언어결과실행 시간메모리
884718TAFHRed-blue table (IZhO19_stones)C++17
27 / 100
27 ms1372 KiB
#include <bits/stdc++.h>

#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define mp make_pair
#define mt make_tuple
#define ull unsigned long long
#define ll long long
#define dl long double
#define forn(i, n) for(int i = 0; i < n; i++)
using namespace std;

void start() {
    int n, m;
    cin >> n >> m;

    char ans[n][m];
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < m; j++) {
            if (n > m) {
                if (j < m / 2 + 1) {
                    ans[i][j] = '+';
                }
                else {
                    ans[i][j] = '-';
                }
            }
            else {
                if (i < n / 2 + 1) {
                    ans[i][j] = '-';
                }
                else {
                    ans[i][j] = '+';
                }
            }
        }
    }

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

int main() {
    //SPEED;
    int t = 1;
    cin >> t;
    while(t--) {
        start();
    }
} 
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...