Submission #344194

# Submission time Handle Problem Language Result Execution time Memory
344194 2021-01-05T08:53:45 Z koketsu Red-blue table (IZhO19_stones) C++14
0 / 100
34 ms 1388 KB
#include <bits/stdc++.h>
#define pb push_back
#define LL long long
#define Kultivator ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

const LL Mxn = 1e6 + 7;
const LL Mod = 1e9 + 7;
const LL Inf = 1e14 + 7;

int N, M;

int main(){
    Kultivator;
    int tt;
    cin >> tt;
    while(tt--){
        cin >> N >> M;
        if(N == 1){
            cout << M << '\n';
            for(int i = 1; i <= M; i++){
                cout << '-';
            }
        } else if(M == 1){
            cout << N << '\n';
            for(int i = 1; i <= N; i++){
                cout << '+';
            }
        } else if(N % 2 && M % 2){
            cout << max(N, M) + (min(N, M) / 2) << '\n';
            for(int i = 1; i <= N; i++){
                for(int j = 1; j <= M; j++){
                    if(N <= M){
                        if(i > (N / 2) + 1){
                            cout << '+';
                        } else {
                            cout << '-';
                        }
                    } else {
                        if(j > (M / 2) + 1){
                            cout << '-';
                        } else {
                            cout << '+';
                        }
                    }
                }
                cout << '\n';
            }
        }
        cout << '\n';
    }
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 1 ms 364 KB Wrong answer
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong answer
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 1 ms 364 KB Wrong answer
# Verdict Execution time Memory Grader output
1 Incorrect 34 ms 1388 KB Wrong answer in test 97 21: 107 < 116
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 18 ms 876 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 1 ms 364 KB Wrong answer